Skip to content

Commit

Permalink
Migrate to O.11
Browse files Browse the repository at this point in the history
  • Loading branch information
djeang committed Jun 17, 2024
1 parent fbd3e26 commit 1a9a694
Show file tree
Hide file tree
Showing 17 changed files with 196 additions and 465 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: "./jeka project: pack maven: publish"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.jeka-work
/jeka-output
94 changes: 94 additions & 0 deletions .idea/dev.jeka.demo-build-templates.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 0 additions & 66 deletions .idea/dev.jeka.template-examples.iml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
File renamed without changes.
65 changes: 65 additions & 0 deletions jeka-src/Build.java
Original file line number Diff line number Diff line change
@@ -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);
}

}
8 changes: 8 additions & 0 deletions jeka.properties
Original file line number Diff line number Diff line change
@@ -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


2 changes: 0 additions & 2 deletions jeka/.gitignore

This file was deleted.

53 changes: 0 additions & 53 deletions jeka/def/Build.java

This file was deleted.

11 changes: 0 additions & 11 deletions jeka/local.properties

This file was deleted.

Binary file removed jeka/wrapper/dev.jeka.jeka-core-wrapper.jar
Binary file not shown.
22 changes: 0 additions & 22 deletions jeka/wrapper/wrapper.properties

This file was deleted.

Loading

0 comments on commit 1a9a694

Please sign in to comment.