Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
Release:1.0.0.RC1 #1
Browse files Browse the repository at this point in the history
  • Loading branch information
M999JAD authored and M999JAD committed Oct 8, 2021
1 parent f78ea0f commit 38bdf05
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 61 deletions.
22 changes: 5 additions & 17 deletions dev.jeka.plugins.sonarqube/dev.jeka.plugins.sonarqube.iml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,13 @@
<orderEntry type="inheritedJdk"/>
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/jeka/def" isTestSource="true"/>
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false"/>
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false"/>
<sourceFolder url="file://$MODULE_DIR$/jeka/output/generated_sources/java" isTestSource="false"/>
<excludeFolder url="file://$MODULE_DIR$/jeka/output"/>
<excludeFolder url="file://$MODULE_DIR$/jeka/.work"/>
<excludeFolder url="file://$MODULE_DIR$/.idea/output"/>
</content>
<orderEntry type="sourceFolder" forTests="false"/>
<orderEntry type="module-library" scope="COMPILE" exported="">
<library>
<CLASSES>
<root url="jar://$JEKA_USER_HOME$/cache/wrapper/0.9.15.M1/dev.jeka.jeka-core.jar!/"/>
</CLASSES>
<JAVADOC>
<root url="jar://$JEKA_USER_HOME$/cache/wrapper/0.9.15.M1/dev.jeka.jeka-core-javadoc.jar!/"/>
</JAVADOC>
<SOURCES>
<root url="jar://$JEKA_USER_HOME$/cache/wrapper/0.9.15.M1/libs-sources/dev.jeka.jeka-core-sources.jar!/"/>
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST" exported="" forJeka="">
<library>
<CLASSES>
Expand All @@ -38,13 +26,13 @@
<orderEntry type="module-library" scope="TEST" exported="" forJeka="">
<library>
<CLASSES>
<root url="jar://$JEKA_USER_HOME$/cache/wrapper/0.9.15.M1/dev.jeka.jeka-core.jar!/"/>
<root url="jar://$JEKA_USER_HOME$/cache/wrapper/0.9.15.M2/dev.jeka.jeka-core.jar!/"/>
</CLASSES>
<JAVADOC>
<root url="jar://$JEKA_USER_HOME$/cache/wrapper/0.9.15.M1/dev.jeka.jeka-core-javadoc.jar!/"/>
<root url="jar://$JEKA_USER_HOME$/cache/wrapper/0.9.15.M2/dev.jeka.jeka-core-javadoc.jar!/"/>
</JAVADOC>
<SOURCES>
<root url="jar://$JEKA_USER_HOME$/cache/wrapper/0.9.15.M1/libs-sources/dev.jeka.jeka-core-sources.jar!/"/>
<root url="jar://$JEKA_USER_HOME$/cache/wrapper/0.9.15.M2/libs-sources/dev.jeka.jeka-core-sources.jar!/"/>
</SOURCES>
</library>
</orderEntry>
Expand Down
86 changes: 43 additions & 43 deletions dev.jeka.plugins.sonarqube/jeka/def/Build.java
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
import dev.jeka.core.api.depmanagement.JkRepoSet;
import dev.jeka.core.api.depmanagement.JkVersion;
import dev.jeka.core.api.java.JkJavaVersion;
import dev.jeka.core.api.system.JkLocator;
import dev.jeka.core.api.tooling.JkGitProcess;
import dev.jeka.core.tool.JkClass;
import dev.jeka.core.tool.JkEnv;
import dev.jeka.core.tool.JkPlugin;
import dev.jeka.core.tool.builtins.git.JkPluginGit;
import dev.jeka.core.tool.builtins.java.JkPluginJava;

import java.util.Optional;
import dev.jeka.core.tool.builtins.release.JkPluginVersionFromGit;
import dev.jeka.core.tool.builtins.repos.JkPluginGpg;

class Build extends JkClass {

final JkPluginJava javaPlugin = getPlugin(JkPluginJava.class);
private final JkPluginJava java = getPlugin(JkPluginJava.class);

@JkEnv("OSSRH_USER")
public String ossrhUser;

@JkEnv("OSSRH_PWD")
public String ossrhPwd;

final JkPluginGit gitPlugin = getPlugin(JkPluginGit.class);
final JkPluginGpg gpg = getPlugin(JkPluginGpg.class);

final JkPluginVersionFromGit versionFromGit = getPlugin(JkPluginVersionFromGit.class);

@Override
protected void setup() {
javaPlugin.getProject().simpleFacade()
.setJavaVersion(JkJavaVersion.V8)
.setSimpleLayout()
.mixResourcesAndSources()
.setCompileDependencies(deps -> deps
.andFiles(JkLocator.getJekaJarPath())
);
JkPlugin.setJekaPluginCompatibilityRange(javaPlugin.getProject().getConstruction().getManifest(),
"0.9.15.M1",
JkPlugin.setJekaPluginCompatibilityRange(java.getProject().getConstruction().getManifest(),
"0.9.15.M2",
"https://raw.githubusercontent.com/jerkar/sonarqube-plugin/master/breaking_versions.txt");
java.getProject().simpleFacade()
.setJavaVersion(JkJavaVersion.V8)
.mixResourcesAndSources()
.setSimpleLayout()
.setCompileDependencies(deps -> deps
.andFiles(JkLocator.getJekaJarPath())
);


// This section is necessary to publish on a public repository
javaPlugin.getProject().getPublication()
.getMaven()
.setModuleId("dev.jeka:sonarqube-plugin")
.setVersion(this::version)
.getPomMetadata()
java.getProject().getPublication().getMaven()
.setModuleId("dev.jeka:sonarqube-plugin")
.setRepos(JkRepoSet.ofOssrhSnapshotAndRelease(ossrhUser, ossrhPwd,
gpg.get().getSigner("")))
.getPomMetadata()
.getProjectInfo()
.setName("Jeka plugin for Sonarqube")
.setDescription("A Jeka plugin for Jacoco coverage tool")
.setUrl("https://github.com/jerkar/sonarqube-plugin")
.__
.getScm()
.setUrl("https://github.com/jerkar/sonarqube-plugin").__
.addApache2License()
.getProjectInfo()
.setName("Jeka plugin for SonarQube")
.setDescription("A Jeka plugin for SonarQube")
.setUrl("https://github.com/jerkar/sonarqube-plugin").__
.getScm()
.setUrl("https://github.com/jerkar/sonarqube-plugin").__.__.__
.getPostActions()
.append(this::tagIfNeeded);
}
.addGithubDeveloper("djeang", "[email protected]");

public void cleanPack() {
clean(); javaPlugin.pack();
// Make javadoc only for releases
if (!JkVersion.of(java.getProject().getPublication().getVersion()).isSnapshot()) {
java.pack.javadoc = true;
}
}

private String version() {
String currentTagVersion = gitPlugin.getWrapper().getVersionFromTag();
currentTagVersion = currentTagVersion.equals("HEAD-SNAPSHOT") ? "master-SNAPSHOT" : currentTagVersion;
String releaseVersion = gitPlugin.getWrapper().extractSuffixFromLastCommitMessage("Release:");
return Optional.ofNullable(releaseVersion).orElse(currentTagVersion);
public void cleanPack() {
clean(); java.pack();
}

private void tagIfNeeded() {
JkGitProcess git = gitPlugin.getWrapper();
Optional.ofNullable(git.extractSuffixFromLastCommitMessage("Release:"))
.ifPresent(version -> git.tagAndPush(version));
}

}
2 changes: 1 addition & 1 deletion dev.jeka.plugins.sonarqube/jeka/wrapper/jeka.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# 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.9.15.M1
jeka.version=0.9.15.M2

# 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.
Expand Down

0 comments on commit 38bdf05

Please sign in to comment.