Skip to content

Commit

Permalink
Migrate to JeKa 0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
djeang committed Jun 15, 2024
1 parent b65e546 commit a7cd2e0
Show file tree
Hide file tree
Showing 41 changed files with 139 additions and 1,090 deletions.
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
17 changes: 0 additions & 17 deletions .idea/aws.xml

This file was deleted.

17 changes: 0 additions & 17 deletions .idea/compiler.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/encodings.xml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/jarRepositories.xml

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/misc.xml

This file was deleted.

37 changes: 22 additions & 15 deletions .idea/openapi-plugin.iml

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

124 changes: 0 additions & 124 deletions .idea/uiDesigner.xml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Build Status](https://github.com/jeka-dev/openapi-plugin/actions/workflows/main.yml/badge.svg)
![_dev.sample.Build Status](https://github.com/jeka-dev/openapi-plugin/actions/workflows/main.yml/badge.svg)
[![Maven Central](https://img.shields.io/maven-central/v/dev.jeka/openapi-plugin)](https://search.maven.org/search?q=g:%22dev.jeka%22%20AND%20a:%22openapi-plugin%22)

# Openapi generator for JeKa
Expand Down Expand Up @@ -44,7 +44,7 @@ openapi.gen.myClient=generate -g client \
-i https://my.spec.server/an-api.json
```

See project example [here](./sample-props).
See project example [here](./_dev.sample-props).

## Using programmatic method

Expand Down Expand Up @@ -84,7 +84,7 @@ public class SampleBuild_Programmatic extends JkBean {
}
```

See project example [here](./sample-props).
See project example [here](./_dev.sample-props).

## Developers

Expand Down
File renamed without changes.
57 changes: 57 additions & 0 deletions jeka-src/_dev/Build.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package _dev;

import dev.jeka.core.api.crypto.gpg.JkGpgSigner;
import dev.jeka.core.api.depmanagement.JkRepoSet;
import dev.jeka.core.tool.JkInjectClasspath;
import dev.jeka.core.tool.JkInjectProperty;
import dev.jeka.core.tool.JkJekaVersionRanges;
import dev.jeka.core.tool.KBean;
import dev.jeka.core.tool.builtins.base.BaseKBean;
import dev.jeka.core.tool.builtins.tooling.git.GitKBean;
import dev.jeka.core.tool.builtins.tooling.maven.MavenKBean;
import dev.jeka.plugins.nexus.NexusKBean;

@JkInjectClasspath("org.projectlombok:lombok:1.18.24")
@JkInjectClasspath("dev.jeka:nexus-plugin")
class Build extends KBean {

@JkInjectProperty("OSSRH_USER")
public String ossrhUser;

@JkInjectProperty("OSSRH_PWD")
public String ossrhPwd;

@JkInjectProperty("JEKA_GPG_PASSPHRASE")
public String secretRingPassword;

private final BaseKBean baseKBean = load(BaseKBean.class);

protected void init() {

JkJekaVersionRanges.setCompatibilityRange(baseKBean.getManifest(),
"0.11.0-alpha.3",
"https://raw.githubusercontent.com/jeka-dev/openapi-plugin/master/breaking_versions.txt");

// Publish on ossrh
load(MavenKBean.class).getMavenPublication()
.setModuleId("dev.jeka:openapi-plugin")
.setRepos(publishRepos())
.pomMetadata
.setProjectName("OpenApi plugin for JeKa")
.setProjectDescription("OpenApi plugin for JeKa")
.addGithubDeveloper("Jerome Angibaud", "djeang_dev@yahoo.fr")
.setProjectUrl("https://github.com/jeka-dev/openapi-plugin")
.setScmUrl("https://github.com/jeka-dev/openapi-plugin.git")
.addApache2License();
load(NexusKBean.class); // Loading this KBean will automatically configure MavenKBean for publishing on Nexus

load(GitKBean.class).handleVersioning = true;

}

private JkRepoSet publishRepos() {
JkGpgSigner gpgSigner = JkGpgSigner.ofStandardProject(getBaseDir());
return JkRepoSet.ofOssrhSnapshotAndRelease(ossrhUser, ossrhPwd, gpgSigner);
}

}
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
package sample;
package _dev.sample;

import dev.jeka.core.api.project.JkProject;
import dev.jeka.core.api.system.JkLog;
import dev.jeka.core.tool.JkBean;
import dev.jeka.core.tool.builtins.project.ProjectJkBean;
import dev.jeka.core.tool.KBean;
import dev.jeka.plugins.openapi.JkOpenApi;
import dev.jeka.plugins.openapi.JkOpenapiCmdBuilder;
import dev.jeka.plugins.openapi.OpenapiJkBean;

/**
* Sample using only properties of OpenApiJkBean
*/
public class SampleBuild_KBeanProgrammatic extends JkBean {
public class SampleBuild_KBeanProgrammatic extends KBean {

private static final String SPEC_URL = "https://petstore.swagger.io/v2/swagger.json";

Expand Down
Loading

0 comments on commit a7cd2e0

Please sign in to comment.