From 1a9a694be820712db77d3eb70bca394d5f638bb5 Mon Sep 17 00:00:00 2001 From: Jerome Angibaud Date: Tue, 18 Jun 2024 01:07:48 +0200 Subject: [PATCH] Migrate to O.11 --- .github/workflows/main.yml | 7 +- .gitignore | 2 + .idea/dev.jeka.demo-build-templates.iml | 94 ++++++++ .idea/dev.jeka.template-examples.iml | 66 ------ .idea/modules.xml | 2 +- README.md | 5 +- {jeka/gpg => gpg}/secring.gpg | Bin jeka-src/Build.java | 65 ++++++ jeka.properties | 8 + jeka/.gitignore | 2 - jeka/def/Build.java | 53 ----- jeka/local.properties | 11 - jeka/wrapper/dev.jeka.jeka-core-wrapper.jar | Bin 9287 -> 0 bytes jeka/wrapper/wrapper.properties | 22 -- jekaw | 211 ------------------ jekaw.bat | 66 ------ .../templates/SpringBootTemplateBuild.java | 47 ++-- 17 files changed, 196 insertions(+), 465 deletions(-) create mode 100644 .gitignore create mode 100644 .idea/dev.jeka.demo-build-templates.iml delete mode 100644 .idea/dev.jeka.template-examples.iml rename {jeka/gpg => gpg}/secring.gpg (100%) create mode 100644 jeka-src/Build.java create mode 100644 jeka.properties delete mode 100644 jeka/.gitignore delete mode 100644 jeka/def/Build.java delete mode 100644 jeka/local.properties delete mode 100644 jeka/wrapper/dev.jeka.jeka-core-wrapper.jar delete mode 100644 jeka/wrapper/wrapper.properties delete mode 100755 jekaw delete mode 100644 jekaw.bat rename src/{main/java/dev/jeka/examples => dev/jeka/demo}/templates/SpringBootTemplateBuild.java (74%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf1be7d..50c2ce5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,14 +15,9 @@ jobs: steps: - uses: actions/checkout@v3 - run: git fetch --prune --unshallow --tags - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - name: Build and publish env: OSSRH_USER: ${{ secrets.OSSRH_USER }} OSSRH_PWD: ${{ secrets.OSSRH_PWD }} JEKA_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: ./jekaw project#pack project#publish \ No newline at end of file + run: "./jeka project: pack maven: publish" \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ca7300 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.jeka-work +/jeka-output \ No newline at end of file diff --git a/.idea/dev.jeka.demo-build-templates.iml b/.idea/dev.jeka.demo-build-templates.iml new file mode 100644 index 0000000..87bcc4a --- /dev/null +++ b/.idea/dev.jeka.demo-build-templates.iml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/dev.jeka.template-examples.iml b/.idea/dev.jeka.template-examples.iml deleted file mode 100644 index 5e9e520..0000000 --- a/.idea/dev.jeka.template-examples.iml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.idea/modules.xml b/.idea/modules.xml index 949cedf..2868dfc 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/README.md b/README.md index 7f4d98d..ac6e7f8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ and adjusting templates to the current infrastructure. ## Springboot + ReactJs -[This template](./src/main/java/dev/jeka/examples/templates/SpringBootTemplateBuild.java) defines a build for +[This template](src/dev/jeka/demo/templates/SpringBootTemplateBuild.java) defines a build for Spring-Boot projects that optionally contain a ReactJs frontend. The build actually compiles, runs tests with coverage, builds reactJs, performs Sonarqube analysis and produces a bootable jar, @@ -26,8 +26,7 @@ are specified in *project-dependencies.txt*. ```properties # Import the template in the classpath jeka.classpath.inject=dev.jeka:template-examples:0.10.45.0 -jeka.default.kbean=dev.jeka.examples.templates.SpringBootTemplateBuild - +jeka.default.kbean=dev.jeka.demo.templates.SpringBootTemplateBuild # Set project specific values jeka.java.version=21 kb#springbootVersion=3.1.5 diff --git a/jeka/gpg/secring.gpg b/gpg/secring.gpg similarity index 100% rename from jeka/gpg/secring.gpg rename to gpg/secring.gpg diff --git a/jeka-src/Build.java b/jeka-src/Build.java new file mode 100644 index 0000000..0d327eb --- /dev/null +++ b/jeka-src/Build.java @@ -0,0 +1,65 @@ +import dev.jeka.core.api.crypto.gpg.JkGpgSigner; +import dev.jeka.core.api.depmanagement.JkRepoSet; +import dev.jeka.core.api.project.JkCompileLayout; +import dev.jeka.core.api.project.JkProject; +import dev.jeka.core.api.system.JkInfo; +import dev.jeka.core.api.tooling.git.JkVersionFromGit; +import dev.jeka.core.tool.JkInjectProperty; +import dev.jeka.core.tool.JkJekaVersionRanges; +import dev.jeka.core.tool.KBean; +import dev.jeka.core.tool.builtins.project.ProjectKBean; +import dev.jeka.core.tool.builtins.tooling.maven.MavenKBean; +import dev.jeka.plugins.nexus.JkNexusRepos; + + +class Build extends KBean { + + final JkProject project = load(ProjectKBean.class).project; + + final MavenKBean mavenKBean = load(MavenKBean.class); + + @JkInjectProperty("OSSRH_USER") + public String ossrhUser; // OSSRH user and password will be injected from environment variables + + @JkInjectProperty("OSSRH_PWD") + public String ossrhPwd; + + protected void init() { + String jekaVersion = JkInfo.getJekaVersion(); + + // source layout + project.flatFacade() + .setLayoutStyle(JkCompileLayout.Style.SIMPLE) + .mixResourcesAndSources(); + + project.compilation.customizeDependencies(deps -> deps + .and("dev.jeka:jeka-core:" + jekaVersion) + .and("dev.jeka:nodejs-plugin:" + jekaVersion) + .and("dev.jeka:sonarqube-plugin:" + jekaVersion) + .and("dev.jeka:jacoco-plugin:" + jekaVersion) + .and("dev.jeka:springboot-plugin:" + jekaVersion) + ); + JkJekaVersionRanges.setCompatibilityRange(project.packaging.getManifest(), + jekaVersion, + "https://raw.githubusercontent.com/jeka-dev/template-examples/master/breaking_versions.txt"); + + // Set required information to be published on Maven Central + JkGpgSigner gpgSigner = JkGpgSigner.ofStandardProject(this.getBaseDir()); + JkRepoSet repos = JkRepoSet.ofOssrhSnapshotAndRelease(ossrhUser, ossrhPwd, gpgSigner); + + mavenKBean.getMavenPublication() + .setModuleId("dev.jeka:template-examples") + .setRepos(repos) + .pomMetadata + .addApache2License() + .addGithubDeveloper("djeangdev", "djeangdev@yahoo.fr") + .setProjectName("Collection of build templates for JeKa") + .setProjectDescription("Provides opinionated KBeans for building projects with minimal typing.") + .setProjectUrl("https://github.com/jeka-dev/template-examples") + .setScmUrl("https://github.com/jeka-dev/template-examples.git"); + + JkNexusRepos.handleAutoRelease(mavenKBean.getMavenPublication()); + JkVersionFromGit.of().handleVersioning(project); + } + +} \ No newline at end of file diff --git a/jeka.properties b/jeka.properties new file mode 100644 index 0000000..0943554 --- /dev/null +++ b/jeka.properties @@ -0,0 +1,8 @@ +jeka.version=0.11.0-alpha.7 +jeka.java.version=17 + +jeka.inject.classpath=dev.jeka:nexus-plugin + +@intellij.downloadSources=true + + diff --git a/jeka/.gitignore b/jeka/.gitignore deleted file mode 100644 index 6e99d14..0000000 --- a/jeka/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/.work -/output \ No newline at end of file diff --git a/jeka/def/Build.java b/jeka/def/Build.java deleted file mode 100644 index e3dac5d..0000000 --- a/jeka/def/Build.java +++ /dev/null @@ -1,53 +0,0 @@ -import dev.jeka.core.api.crypto.gpg.JkGpg; -import dev.jeka.core.api.depmanagement.JkRepoSet; -import dev.jeka.core.api.depmanagement.publication.JkNexusRepos; -import dev.jeka.core.api.project.JkProject; -import dev.jeka.core.api.system.JkInfo; -import dev.jeka.core.api.system.JkLocator; -import dev.jeka.core.tool.JkBean; -import dev.jeka.core.tool.JkInjectProperty; -import dev.jeka.core.tool.JkJekaVersionCompatibilityChecker; -import dev.jeka.core.tool.builtins.git.JkVersionFromGit; -import dev.jeka.core.tool.builtins.project.ProjectJkBean; - -class Build extends JkBean { - - final ProjectJkBean projectBean = getBean(ProjectJkBean.class).lately(this::configure); - - @JkInjectProperty("OSSRH_USER") - public String ossrhUser; // OSSRH user and password will be injected from environment variables - - @JkInjectProperty("OSSRH_PWD") - public String ossrhPwd; - - private void configure(JkProject project) { - String jekaVersion = JkInfo.getJekaVersion(); - project.compilation.configureDependencies(deps -> deps - .andFiles(JkLocator.getJekaJarPath()) - .and("dev.jeka:nodejs-plugin:" + jekaVersion) - .and("dev.jeka:sonarqube-plugin:" + jekaVersion) - .and("dev.jeka:jacoco-plugin:" + jekaVersion) - .and("dev.jeka:springboot-plugin:" + jekaVersion) - ); - JkJekaVersionCompatibilityChecker.setCompatibilityRange(project.packaging.manifest, - jekaVersion, - "https://raw.githubusercontent.com/jeka-dev/template-examples/master/breaking_versions.txt"); - - // Set required information to be published on Maven Central - JkGpg gpg = JkGpg.ofStandardProject(this.getBaseDir()); - project.publication - .setModuleId("dev.jeka:template-examples") - .setRepos(JkRepoSet.ofOssrhSnapshotAndRelease(ossrhUser, ossrhPwd, gpg.getSigner(""))) - .maven - .pomMetadata - .addApache2License() - .addGithubDeveloper("djeangdev", "djeangdev@yahoo.fr") - .setProjectName("Collection of build templates for JeKa") - .setProjectDescription("Provides opinionated KBeans for building projects with minimal typing.") - .setProjectUrl("https://github.com/jeka-dev/template-examples") - .setScmUrl("https://github.com/jeka-dev/template-examples.git"); - JkNexusRepos.handleAutoRelease(project); - JkVersionFromGit.of().handleVersioning(project); - } - -} \ No newline at end of file diff --git a/jeka/local.properties b/jeka/local.properties deleted file mode 100644 index 43fa0be..0000000 --- a/jeka/local.properties +++ /dev/null @@ -1,11 +0,0 @@ -## -# Properties defined here, override those defined at global level ([USER_HOME]/.jeka/global.properties) but -# can be overridden by system properties and environment variables. -# -# See : https://jeka-dev.github.io/jeka/reference-guide/execution-engine-properties/ -# -# Hit Ctrl+ to get auto-completion when using IDE Jeka plugin. -# -# If you don't need it, fell free to remove this file. -## -jeka.java.version=17 diff --git a/jeka/wrapper/dev.jeka.jeka-core-wrapper.jar b/jeka/wrapper/dev.jeka.jeka-core-wrapper.jar deleted file mode 100644 index d40269fcb5e5de42b964a8a3ef4a417311b3417d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9287 zcmb7~Wl$WgTQQ{?k=mkBU6}J5-qeDBN6nTK_rtNB0f}2gcmO6QH4v0fQ80z;E%t zo65gMQ2v3~TG*NVPdLoKb7oGi7XK5N;9p=bR}*Jv3)la52p$X!GV*^O7X2ArA%O}8 z#z`6mhWg)zh&egATevct*_*hz{mWI9>!BE{FD(fjPMdE`?a_vtkS$ZjQ30tbF{2}~ zDZjmwS^4TBgZM$la%U>MZn@mCElvZd*;LmKR@H0kYUw*d+}!tnwZR#c~vd$n%bJ|^N&~*KHX86h7Yv`oAE6 zz*}}N964UTkGeiVbCbWupM8DSwhjT835KBY$>$eJ(CQZ8*@o>rji_H$hT##&cE}V6 zO7EvzY9R5?9qf?5BtZ;XP~Pv|oY~yr-@9}G1dYvjT^ShqZfx~n_>L;GKlTI)4cve5 zZzw$9eYV&+A1@u7MCx0!yP#UVfS-3?**YhADJmqm5LZ1<9UC?b9GMipxGsGWFZO2? z8BxZ+T6o!oVHL)w9G#K9wF>;h`z9vW&+(vjC1iWi@VYqBe|hEfO8K0h8Faoc?EUBi z=%;k+ha3uD752WQWEy338L>WS@SfWR@@2j;CjG+rBR?21R!brLmi|UpCyn-a&h|`V z7`QO`c5$VL_@+kpkU98vr$+cDP44vkNEWC?{+159-@61UyoC%>JlSxY4SC@`;xi!l z?u+HR%8z{|3S4YJeW=p%q5NQB{5HXWMZs17VyFSpsL;ZfwQADB7~HFo=#KQ&7yw54 zEIBt2!;&R$BpY&0sFX^YdCIBH0>2}lYBvxcYV1-`a#D#fn^fc$qN#+W38=Cyx;v|; zKUa%s{3uoZuHmE6X0%k5y64h-VjHQIzoWt4XPdET>95(V@;pk+!6%&Mi9@y3=G%Pby!B;^i)#6$vnCxACwGn5>|k%;j3*ZfF|w zB{XIO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wrq(C^11*iMg;U+&n!>RPCsq~0` z&*g=n&{L%cJEy5pSB-{Fy;t#4>2f74x5eB&H$`VfSH{{#Jp;_~0%G5?9T`#b*+)#bktLhw%^RsRz5f0dWNh2g>cJK5#$ gCp!JNVgIbY{GVV1#J>m_gukjKEDX#f^?%I%7mM|G&Hw-a diff --git a/jeka/wrapper/wrapper.properties b/jeka/wrapper/wrapper.properties deleted file mode 100644 index 923e14e..0000000 --- a/jeka/wrapper/wrapper.properties +++ /dev/null @@ -1,22 +0,0 @@ -## Property file for Jeka wrapper - -# The Jeka version to be used by the wrapper. -# The distribution will be downloaded from a Maven repository according the pattern [REPO URL]/dev/jeka/jeka-core/[jeka.version]/jeka-core-[jeka.version]-distrib.zip . -# By default [REPO URL] is https://repo.maven.apache.org/maven2 . You can switch to another repository by editing repo.download.url property -# located in [JEKA USER HOME DIR]/options.properties file. By default [JEKA USER HOME DIR] is [USER HOME]/.jeka . -jeka.version=0.10.49 - -# By default, Jeka distribution are fetched from maven central repo. The central repo contains only official releases. -# It's possible to use another repository to fetch Jeka distribution using following property as: -# jeka.distrib.repo=https://maven.pkg.github.com/jeka-dev/jeka -# -# If the repo needs credential (this is currently the case for GitHub packages), following environment variables must be set : -# JEKA_WRAPPER_REPO_USERNAME (your GitHub account if using GitHub Packages) -# JEKA_WRAPPER_REPO_PWD (your GitHub Personal Access Token if using GitHub Packages) -# -# jeka.distrib.repo=https://maven.pkg.github.com/jeka-dev/jeka - -# The filesystem location of Jeka distribution to be used by the wrapper. This feature is only useful in very special cases. -# When this property is set, jeka.version is ignored. It can be absolute or relative path to the root of the project to build. -# jeka.distrib.location= - diff --git a/jekaw b/jekaw deleted file mode 100755 index 25f5973..0000000 --- a/jekaw +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/sh - -# returns the value of a property within a property file -# call `prop file propName' -prop() { - if [ ! -f "$1" ]; then - return - fi - grep "^\\s*${2}=" ${1} | cut -d'=' -f2 -} - -# call `propJavaVersion currentDir -propJavaVersion() { - local version=$(prop $1/jeka/local.properties jeka.java.version) - version=$(echo $version | sed 's/ //g') - if [ -z $version ] - then - if [ -d "${1}/../jeka" ] - then - echo $(propJavaVersion "${1}/..") - else - echo "" - fi - return - fi - echo $version -} - -# call `propJdkVersion currentDir javaVersion` -propJdkHome() { - local envValue=$(printenv "JEKA_JDK_${2}") - if [ ! -z $envValue ]; then - echo $envValue - return - fi - envValue=$(printenv "jeka.jdk.${2}") - if [ ! -z $envValue ]; then - echo $envValue - return - fi - local propName="jeka.jdk.${2}" - local path=$(prop $1/jeka/local.properties $propName) - path=$(echo $version | sed 's/ //g') - if [ -z $path ] - then - if [ -d "${1}/../jeka" ] - then - path=$(propJdkHome "${1}/.." ${2}) - else - local jekaUserHome=$JEKA_USER_HOME - if [ -z $jekaUserHome ]; then - jekaUserHome=~/.jeka - fi - propFile=$jekaUserHome/global.properties - path=$(prop $propFile $propName) - fi - fi - echo $path -} - -if [ -z "$Jeka_OPTS" ] ; then - export "JEKA_OPTS= " -fi - -if [ -n "$JEKA_JDK" ] ; then - export JAVA_HOME=$JEKA_JDK - else - workingDir=$(pwd) - javaVersion=$(propJavaVersion $workingDir) - if [ ! -z $javaVersion ]; then - jdkPath=$(propJdkHome $workingDir $javaVersion) - if [ ! -z $jdkPath ]; then - export JAVA_HOME=$jdkPath - fi - fi -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # - # Look for the Apple JDKs first to preserve the existing behaviour, and then look - # for the new JDKs provided by Oracle. - # - if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then - # - # Apple JDKs - # - export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home - fi - - if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then - # - # Apple JDKs - # - export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home - fi - - if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then - # - # Oracle JDKs - # - export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home - fi - - if [ -z "$JAVA_HOME" ] && [ -L "/usr/libexec/java_home" ]; then - # - # Apple JDKs - # - export JAVA_HOME=`/usr/libexec/java_home` - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$JEKA_HOME" ] ; then - ## resolve links - $0 may be a link to jeka's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - JEKA_HOME=`dirname "$PRG"` - - # make it fully qualified - JEKA_HOME=`cd "$JEKA_HOME" && pwd` - - cd "$saveddir" -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JEKA_HOME" ] && - JEKA_HOME=`cygpath --unix "$JEKA_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Migwn, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$JEKA_HOME" ] && - JEKA_HOME="`(cd "$JEKA_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly (valued to $JAVA_HOME )." >&2 - echo " We cannot execute $JAVACMD" >&2 - echo " You can specify which JDK to use by setting JEKA_JDK environment variable." >&2 - exit 1 -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$JEKA_HOME" ] && - JEKA_HOME=`cygpath --path --windows "$JEKA_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -JEKA_CMD_LINE_ARGS="$@" -export JEKA_CMD_LINE_ARGS - -if [ -d "./jeka/boot" ]; then - LOCAL_BUILD_DIR="./jeka/boot/*:" -else - LOCAL_BUILD_DIR="" -fi - -SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" -exec "$JAVACMD" $JEKA_OPTS -cp "$LOCAL_BUILD_DIR$SCRIPTPATH/jeka/wrapper/*" dev.jeka.core.wrapper.Booter $SCRIPTPATH "$@" \ No newline at end of file diff --git a/jekaw.bat b/jekaw.bat deleted file mode 100644 index 12dde7c..0000000 --- a/jekaw.bat +++ /dev/null @@ -1,66 +0,0 @@ -@echo off -setlocal enableDelayedExpansion - -@rem Change here the default JVM options -@rem SET JEKA_OPTS == "" - -@rem set terminal encoding to utf-8 -chcp 65001 > nul - -if not "%JEKA_JDK%" == "" ( - set "JAVA_HOME=%JEKA_JDK%" -) else ( - call :findProp "." "jeka.java.version" version - call :propJdkHome "." !version! result - if not "!result!" == "" set JAVA_HOME=!result! -) -if "%JAVA_HOME%" == "" set "JAVA_CMD=java" -if not "%JAVA_HOME%" == "" set "JAVA_CMD=%JAVA_HOME%\bin\java" - -set "COMMAND="%JAVA_CMD%" %JEKA_OPTS% -cp "%~dp0jeka\wrapper\*" dev.jeka.core.wrapper.Booter "%~dp0." %*" -if not "%JEKA_ECHO_CMD%" == "" ( - @echo on - echo %COMMAND% - @echo off) -%COMMAND% -exit /B %ERRORLEVEL% - -:: read property in a property file. Call :prop propFile, propName, result -:prop -if exist "%~1" ( - for /F "eol=# delims== tokens=1,*" %%a in (%~1) do ( - if "%%a"=="%~2" ( - set %~3=%%b - ) - ) -) -exit /B %ERRORLEVEL% - -:: find a property value in hierarchy local.properties files. Call :propJavaVersion curentDir, propName, result -:findProp -call :prop "%~1\jeka\local.properties" %~2 %~3 -if "%~3" == "" ( - if exist %~1\..\jeka\ ( - call :findProp %~1\.. %~2 %~3 - ) -) -exit /B %ERRORLEVEL% - -:: call `propJdkVersion currentDir javaVersion result` -:propJdkHome -set "envVarName=JEKA_JDK_%~2" -if not "!%envVarName%!"=="" ( - set %~3=!%envVarName%! -) else ( - call :findProp %~1\.. "jeka.jdk.%~2" %~3 - if "!%~3!"=="" ( - if "%JEHA_USER_HOME%" == "" ( - set juh=%homedrive%%homepath%\.jeka - ) else ( - set juh=%JEHA_USER_HOME% - ) - call :prop "!juh!\global.properties" jeka.jdk.%~2 %~3 - ) -) -exit /B %ERRORLEVEL% - diff --git a/src/main/java/dev/jeka/examples/templates/SpringBootTemplateBuild.java b/src/dev/jeka/demo/templates/SpringBootTemplateBuild.java similarity index 74% rename from src/main/java/dev/jeka/examples/templates/SpringBootTemplateBuild.java rename to src/dev/jeka/demo/templates/SpringBootTemplateBuild.java index 9f6eebb..3dbcbc2 100644 --- a/src/main/java/dev/jeka/examples/templates/SpringBootTemplateBuild.java +++ b/src/dev/jeka/demo/templates/SpringBootTemplateBuild.java @@ -1,21 +1,21 @@ -package dev.jeka.examples.templates; +package dev.jeka.demo.templates; import dev.jeka.core.api.depmanagement.JkDepSuggest; -import dev.jeka.core.api.java.JkJavaProcess; import dev.jeka.core.api.java.JkManifest; import dev.jeka.core.api.project.JkIdeSupport; import dev.jeka.core.api.project.JkIdeSupportSupplier; import dev.jeka.core.api.project.JkProject; -import dev.jeka.core.tool.JkBean; import dev.jeka.core.tool.JkDoc; import dev.jeka.core.tool.JkInjectProperty; +import dev.jeka.core.tool.KBean; import dev.jeka.plugins.jacoco.JkJacoco; import dev.jeka.plugins.nodejs.JkNodeJs; import dev.jeka.plugins.sonarqube.JkSonarqube; -import dev.jeka.plugins.springboot.JkSpringboot; +import dev.jeka.plugins.springboot.JkSpringbootProject; import java.nio.file.Files; import java.nio.file.Path; +import java.util.List; @JkDoc(""" Builds a Spring-Boot project, optionally containing a reactjs frontend. @@ -26,7 +26,7 @@ The project version, along the SonarQube host/token props, are expected to be injected by the CI tool. """) -public class SpringBootTemplateBuild extends JkBean implements JkIdeSupportSupplier { +public class SpringBootTemplateBuild extends KBean implements JkIdeSupportSupplier { @JkDepSuggest(versionOnly = true, hint = "org.jacoco:org.jacoco.agent:") public static final String JACOCO_VERSION = "0.8.11"; @@ -38,10 +38,6 @@ public class SpringBootTemplateBuild extends JkBean implements JkIdeSupportSuppl public static final String REACTJS_BASE_DIR = "reactjs-client"; - @JkDepSuggest(versionOnly = true, hint = "org.springframework.boot:spring-boot-starter-parent:") - @JkDoc("Spring-Boot version") - public String springbootVersion = "3.2.0"; - // Do not enforce to use a specific of NodeJs. Propose latest LTS versions instead. @JkDepSuggest(versionOnly = true, hint = "20.10.0,18.19.0,16.20.2") public String nodeJsVersion = NODEJS_VERSION; @@ -61,32 +57,32 @@ public void pack() { @JkDoc("Performs a build including quality static analysis.") public void packQuality() { JkProject project = project(); - JkJacoco.ofVersion(getRuntime().getDependencyResolver(), JACOCO_VERSION) - .configureForAndApplyTo(project); + JkJacoco.ofVersion(getRunbase().getDependencyResolver(), JACOCO_VERSION) + .configureFor(project); project.clean().pack(); sonarqubeBase() .configureFor(project) // applies properties declared in local.properties and starting with '.sonar' prefix' - .setProperties(getRuntime().getProperties().getAllStartingWith("sonar.", true)) + .setProperties(getRunbase().getProperties().getAllStartingWith("sonar.", true)) .run(); // Apply sonarQQube analysis on NodeJs code as well, if present. if (Files.exists(reactBaseDir())) { sonarqubeBase() - .setProperty(JkSonarqube.PROJECT_KEY, project.publication.getModuleId().getColonNotation() + "-js") + .setProperty(JkSonarqube.PROJECT_KEY, project.getModuleId()+ "-js") .setProperty(JkSonarqube.PROJECT_VERSION, projectVersion) .setProperty(JkSonarqube.LANGUAGE, "javascript") .setProperty(JkSonarqube.SOURCES, REACTJS_BASE_DIR) .setProperty("exclusions", "node_modules") - .setProperties(getRuntime().getProperties()) + .setProperties(getRunbase().getProperties()) .run(); } } @JkDoc("Executes the built bootable jar") public void runJar() { - project().runMainJar(false, "", ""); + project().prepareRunJar(JkProject.RuntimeDeps.EXCLUDE).run(); } @JkDoc("Displays the dependency tree on the console.") @@ -101,20 +97,23 @@ public JkIdeSupport getJavaIdeSupport() { private JkProject project() { JkProject project = JkProject.of(); - project.publication.setModuleId(moduleId); - project.publication.setVersion(projectVersion); - project.packaging.manifest.addMainAttribute(JkManifest.IMPLEMENTATION_VERSION, projectVersion); + project.setModuleId(moduleId); + project.setVersion(projectVersion); + project.packaging.getManifest().addMainAttribute(JkManifest.IMPLEMENTATION_VERSION, projectVersion); // Configure project as a Spring-Boot application - JkSpringboot.of() - .setSpringbootVersion(springbootVersion) - .configure(project); + JkSpringbootProject.of(project).configure(); // Build reactJs if 'reactjs-client' dir is present. // The bundled js app is copied in 'resources/static'. if (Files.exists(reactBaseDir())) { - JkNodeJs.ofVersion(nodeJsVersion).configure(project, REACTJS_BASE_DIR, "build", - "npx yarn install ", "npm run build"); + JkNodeJs.ofVersion(nodeJsVersion).configure( + project, + REACTJS_BASE_DIR, + "build", + "static", + List.of("npx yarn install ", "npm run build"), + List.of()); } return project; } @@ -124,7 +123,7 @@ private Path reactBaseDir() { } private JkSonarqube sonarqubeBase() { - return JkSonarqube.ofVersion(getRuntime().getDependencyResolver(), SONARQUBE_VERSION); + return JkSonarqube.ofVersion(getRunbase().getDependencyResolver(), SONARQUBE_VERSION); } }