diff --git a/.gitignore b/.gitignore index f9519bf..1430f02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,24 @@ +<<<<<<< HEAD +<<<<<<< HEAD build/ .gradle/ .classpath .project .settings/ bin/ +<<<<<<< HEAD +======= +.gradle/ +build/ +>>>>>>> Setup buildsystem +======= +build/ +.gradle/ +.classpath +.project +.settings/ +bin/ +>>>>>>> changed Gradle wrapper to version 2.5 +======= +.vscode/ +>>>>>>> update build.gradle diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7236526..4363a61 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,18 @@ +<<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> Import sources Create Application: stage: build script: - chmod +x gradlew - ./gradlew build +<<<<<<< HEAD +======= +>>>>>>> update build.gradle +======= +>>>>>>> Import sources Create Documentation: stage: build script: @@ -11,5 +20,15 @@ Create Documentation: - ./gradlew asciidoctor artifacts: paths: +<<<<<<< HEAD - build/asciidoc/pdf/generations.pdf +======= + - build/docs/asciidocPdf/generations.pdf + +Build Library: + stage: build + script: + - chmod +x gradlew + - ./gradlew publish +>>>>>>> update build.gradle diff --git a/Jenkinsfile b/Jenkinsfile index 239022b..0e28eea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,53 @@ +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> Change Gradle build +======= +>>>>>>> add integration of Jenkins and Nexus +======= +>>>>>>> Imported documentation from repository scriptorium properties([ gitLabConnection('IBTP'), ]) +<<<<<<< HEAD node { stage("Checkout") { checkout scm +<<<<<<< HEAD +======= +======= +// Build and test project generations with documentation +properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '5', artifactNumToKeepStr: '5', daysToKeepStr: '5', numToKeepStr: '5'))]) +======= +>>>>>>> Change Gradle build +node { + stage("Checkout") { + checkout scm +<<<<<<< HEAD +>>>>>>> Import sources + withCredentials([usernamePassword(credentialsId: '201ea374-bda3-4a38-a18a-ccc9c39fb3ff', passwordVariable: 'ORG_GRADLE_PROJECT_nexusPassword', usernameVariable: 'ORG_GRADLE_PROJECT_nexusUsername')]) { +======= + } + gitlabBuilds(builds: ["build", "publish"]) { + stage("Build") { + gitlabCommitStatus("build") { +>>>>>>> Change Gradle build + sh "chmod +x gradlew" + sh "./gradlew clean build" + } + } + stage("Publish Build Results") { + gitlabCommitStatus("publish") { + archiveArtifacts allowEmptyArchive: true, artifacts: "build/asciidoc/pdf/*.pdf" + scanForIssues sourceCodeEncoding: 'UTF-8', tool: taskScanner(highTags: 'FIXME', ignoreCase: true, includePattern: 'src/**/*.adoc', normalTags: 'TODO') + } + } +<<<<<<< HEAD +>>>>>>> Replaced Slack notificatino with Telegram notification } gitlabBuilds(builds: ["build", "publish"]) { stage("Build") { @@ -21,3 +64,46 @@ node { } } } +======= +gradleBuild {} +>>>>>>> add integration of Jenkins and Nexus +<<<<<<< HEAD +<<<<<<< HEAD +======= + } +} +>>>>>>> Import sources +======= +>>>>>>> add integration of Jenkins and Nexus +======= +======= +// Build and test project generations with documentation +properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '5', artifactNumToKeepStr: '5', daysToKeepStr: '5', numToKeepStr: '5'))]) +node { + stage("Build") { + deleteDir() + checkout scm + withCredentials([usernamePassword(credentialsId: '201ea374-bda3-4a38-a18a-ccc9c39fb3ff', passwordVariable: 'ORG_GRADLE_PROJECT_nexusPassword', usernameVariable: 'ORG_GRADLE_PROJECT_nexusUsername')]) { + sh "chmod +x gradlew" + sh "./gradlew clean build asciidoctor -PnexusUrl=https://nexus.ingenieurbuero-peetz.de" + } + slackSend channel: '#devops', color: 'good', message: 'Build generations finished successfully', tokenCredentialId: 'slack-ibtpdev' + + } + stage("Publish Build Results") { + junit allowEmptyResults: true, testResults: '**/build/test-results/**/*.xml' + openTasks canComputeNew: false, defaultEncoding: 'UTF-8', excludePattern: '', healthy: '', high: '', ignoreCase: true, low: '', normal: '', pattern: '*.gradle,**/*.java,**/*.adoc', unHealthy: '' + archiveArtifacts allowEmptyArchive: true, artifacts: "build/asciidoc/pdf/generations.pdf" + } + stage("Publish HTML") { + publishHTML(target: [ + allowMissing: true, + alwaysLinkToLastBuild: true, + keepAll: false, reportDir: 'build/asciidoc/html5', + reportFiles: "generations.html", + reportName: "generations" + ]) + } +} +>>>>>>> Imported documentation from repository scriptorium +>>>>>>> Imported documentation from repository scriptorium diff --git a/build.gradle b/build.gradle index 8cd8ac5..ebfa85b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,44 +1,85 @@ plugins { - id 'org.asciidoctor.jvm.pdf' version '3.1.0' - id 'org.asciidoctor.jvm.gems' version '3.1.0' + id 'org.asciidoctor.jvm.pdf' version '3.3.0' + id 'org.asciidoctor.jvm.gems' version '3.3.0' + id 'java' + id 'maven-publish' } -apply plugin: 'java' - -description = 'Introduction to documentation' -version = '1.0.0-SNAPSHOT' +description = 'Anwendung Generations' +group = 'de.thpeetz.generations' repositories { jcenter() ruby.gems() + maven { + url "https://gitlab.thpeetz.de/api/v4/packages/maven" + name "GitLab" + } } +build.dependsOn(['asciidoctor']) + dependencies { - asciidoctorGems 'rubygems:rouge:3.15.0' + asciidoctorGems 'rubygems:rouge:3.15.0' + implementation 'org.slf4j:slf4j-api:1.7.22' + testImplementation 'junit:junit:4.12' + testImplementation 'org.mockito:mockito-all:1.9.5' +} + +publishing { + publications { + library(MavenPublication) { + from components.java + } + } + repositories { + maven { + url "https://gitlab.thpeetz.de/api/v4/projects/27/packages/maven" + credentials(HttpHeaderCredentials) { + name = "Private-Token" + value = gitLabPrivateToken + } + authentication { + header(HttpHeaderAuthentication) + } + } + } } final BUILD_DATE = new Date().format('dd.MM.yyyy').toString() -final DOK_VERSION = version + +jar { + manifest { + attributes 'Implementation-Title': 'Generations', 'Implementation-Version': version + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} asciidoctorPdf { - dependsOn asciidoctorGemsPrepare + dependsOn asciidoctorGemsPrepare + baseDirFollowsSourceFile() - baseDirFollowsSourceFile() - - asciidoctorj { - attributes 'build-gradle': file('build.gradle'), - 'revdate': BUILD_DATE, - 'revnumber': DOK_VERSION, - 'endpoint-url': 'http://www.ingenieurbuero-peetz.de', - 'imagesdir': './images', - 'toc-title': 'Inhaltsverzeichnis', - 'chapter-label': '', - 'icons': 'font', - 'idprefix': 'id_', - 'idseparator': '-', - 'setanchors': '', - 'docinfo1': '' - } + asciidoctorj { + requires 'rouge' + attributes 'build-gradle': file('build.gradle'), + 'endpoint-url': 'http://www.thpeetz.de', + 'source-highlighter': 'rouge', + 'revdate': BUILD_DATE, + 'revnumber': '1.0.0', + 'revremark': 'Entwurf', + 'imagesdir': './images', + 'toc': 'left', + 'toc-title': 'Inhaltsverzeichnis', + 'chapter-label': '', + 'icons': 'font', + 'idprefix': 'id_', + 'idseparator': '-', + 'docinfo1': '' + } } task asciidoctor(dependsOn: asciidoctorPdf) diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..8d0c7be --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +version=1.0.0-SNAPSHOT diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 490fda8..e708b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradlew b/gradlew index 2fe81a7..4f906e0 100755 --- a/gradlew +++ b/gradlew @@ -82,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -129,6 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 9109989..ac1b06f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,28 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle index deaa3e1..fc6ce52 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1 @@ -rootProject.name = "generations" - +rootProject.name="Generations" diff --git a/src/docs/asciidoc/generations.adoc b/src/docs/asciidoc/generations.adoc index ba7c260..3f70421 100644 --- a/src/docs/asciidoc/generations.adoc +++ b/src/docs/asciidoc/generations.adoc @@ -1,6 +1,6 @@ = Projektbeschreibung generations: Pflichtenheft der Anwendung generations :author: Thomas Peetz -:email: +:email: :doctype: article :sectnums: :sectnumlevels: 4