Remove modules, make jreleaser-tool-provider a non-modular uber JAR

This commit is contained in:
Andres Almiray
2020-11-28 20:05:26 +01:00
parent c4f3c2cccd
commit 11250b39a3
17 changed files with 56 additions and 320 deletions

View File

@@ -16,10 +16,53 @@
* limitations under the License.
*/
dependencies {
api project(':jreleaser')
plugins {
id 'com.github.johnrengelman.shadow'
id 'application'
}
mainClassName = 'org.kordamp.jreleaser.tool.JReleaser'
configurations {
uberjar
}
dependencies {
uberjar project(':jreleaser')
}
sourceSets {
main {
compileClasspath += configurations.uberjar
runtimeClasspath += compileClasspath
}
}
idea {
module {
scopes.PROVIDED.plus += [configurations.uberjar]
}
}
shadowJar {
configurations = [project.configurations.uberjar]
archiveBaseName = project.name
archiveClassifier = ''
exclude 'META-INF/maven/**'
exclude 'META-INF/plexus/**'
exclude 'META-INF/m2e/**'
exclude 'plugin.xml'
}
task relocateShadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = 'jreleaser.shadow'
}
tasks.shadowJar.dependsOn tasks.relocateShadowJar
jar.finalizedBy shadowJar
tasks.withType(JavaCompile) { JavaCompile c ->
c.sourceCompatibility = JavaVersion.VERSION_1_9
c.targetCompatibility = JavaVersion.VERSION_1_9
@@ -30,4 +73,3 @@ java {
languageVersion = JavaLanguageVersion.of(9)
}
}

View File

@@ -1,25 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.tool {
exports org.kordamp.jreleaser.tool;
requires org.kordamp.jreleaser.app;
provides java.util.spi.ToolProvider with
org.kordamp.jreleaser.tool.JReleaserToolProvider;
}

View File

@@ -17,15 +17,16 @@
*/
package org.kordamp.jreleaser.tool;
import org.kordamp.jreleaser.app.Main;
import java.io.PrintWriter;
import java.util.spi.ToolProvider;
import org.kordamp.jreleaser.app.Main;
/**
* @author Andres Almiray
* @since 0.1.0
*/
public class JReleaserToolProvider implements ToolProvider {
public class JReleaser implements ToolProvider {
public String name() {
return "jreleaser";
}
@@ -33,4 +34,8 @@ public class JReleaserToolProvider implements ToolProvider {
public int run(PrintWriter out, PrintWriter err, String... args) {
return Main.run(out, err, args);
}
public static void main(String[] args) {
Main.run(new PrintWriter(System.out), new PrintWriter(System.err), args);
}
}

View File

@@ -1,31 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.app {
exports org.kordamp.jreleaser.app;
requires org.kordamp.jreleaser.util;
requires org.kordamp.jreleaser.model;
requires org.kordamp.jreleaser.config;
requires org.kordamp.jreleaser.tools;
requires org.kordamp.jreleaser.templates;
requires info.picocli;
requires org.slf4j;
requires org.slf4j.simple;
opens org.kordamp.jreleaser.app to info.picocli;
}

View File

@@ -78,14 +78,6 @@ subprojects {
c.targetCompatibility = JavaVersion.VERSION_1_8
}
if (project.projectDir.parentFile.name != 'plugins' &&
project.name != 'jreleaser-tool-provider') {
jar {
multiRelease = true
moduleInfoPath = 'src/main/module/module-info.java'
}
}
license {
exclude('build/**')
exclude('**/*.tpl')

View File

@@ -1,29 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.config.yaml {
exports org.kordamp.jreleaser.config.yaml;
requires org.kordamp.jreleaser.config;
requires org.kordamp.jreleaser.model;
requires org.yaml.snakeyaml;
requires static org.kordamp.jipsy;
requires static org.kordamp.jipsy.annotations;
provides org.kordamp.jreleaser.config.JReleaserConfigParser
with org.kordamp.jreleaser.config.yaml.YamlJReleaserConfigParser;
}

View File

@@ -1,24 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.config {
exports org.kordamp.jreleaser.config;
requires org.kordamp.jreleaser.model;
uses org.kordamp.jreleaser.config.JReleaserConfigParser;
}

View File

@@ -1,22 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.model {
exports org.kordamp.jreleaser.model;
requires org.kordamp.jreleaser.util;
}

View File

@@ -1,23 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.releaser {
exports org.kordamp.jreleaser.releaser;
requires org.kordamp.jreleaser.model;
requires org.kordamp.jreleaser.util;
}

View File

@@ -1,24 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.templates {
exports org.kordamp.jreleaser.templates;
requires org.kordamp.jreleaser.model;
requires org.kordamp.jreleaser.util;
requires com.github.mustachejava;
}

View File

@@ -1,26 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.tools {
exports org.kordamp.jreleaser.tools;
requires org.kordamp.jreleaser.model;
requires org.kordamp.jreleaser.util;
requires org.kordamp.jreleaser.templates;
requires com.github.mustachejava;
requires zt.exec;
}

View File

@@ -1,22 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.util {
exports org.kordamp.jreleaser.util;
requires os.maven.plugin;
}

View File

@@ -18,15 +18,14 @@
group = org.kordamp.jreleaser
version = 0.1.0-SNAPSHOT
#sourceCompatibility = 1.8
#targetCompatibility = 1.8
javaCompatibility = 1.8
sourceCompatibility = 1.8
targetCompatibility = 1.8
kordampPluginVersion = 0.42.0
kordampBuildVersion = 2.1.0
gitPluginVersion = 3.0.0
checksumPluginVersion = 1.1.0
beryxJarPluginVersion = 1.2.0
shadowPluginVersion = 6.1.0
asmVersion = 8.0.1
jacksonVersion = 2.11.3

View File

@@ -1,26 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.sdk.github {
exports org.kordamp.jreleaser.sdk.github;
requires org.kordamp.jreleaser.model;
requires org.kordamp.jreleaser.util;
requires github.api;
requires org.apache.tika.core;
requires okhttp3;
}

View File

@@ -1,25 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.sdk.gitlab {
exports org.kordamp.jreleaser.sdk.gitlab;
requires org.kordamp.jreleaser.model;
requires org.kordamp.jreleaser.util;
requires org.apache.tika.core;
requires gitlab4j.api;
}

View File

@@ -1,24 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module org.kordamp.jreleaser.sdk.sdkman {
exports org.kordamp.jreleaser.sdk.sdkman;
requires org.kordamp.jreleaser.util;
requires okhttp3;
requires com.fasterxml.jackson.databind;
}

View File

@@ -22,7 +22,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "gradle.plugin.org.beryx:badass-jar:$beryxJarPluginVersion"
classpath "com.github.jengelman.gradle.plugins:shadow:$shadowPluginVersion"
classpath "org.ajoberstar:gradle-git-publish:$gitPluginVersion"
classpath "org.kordamp.gradle:java-project-gradle-plugin:$kordampPluginVersion"
classpath "org.kordamp.gradle:groovy-project-gradle-plugin:$kordampPluginVersion"
@@ -57,7 +57,6 @@ projects {
}
dirs(['apps', 'core', 'sdks', 'plugins']) {
id 'java-library'
id 'org.beryx.jar'
}
}
}