Skip to content

Commit

Permalink
build.gradle: include Main-Class in jar
Browse files Browse the repository at this point in the history
Although it only makes sense for the -lib jar; however this avoids to use both
one-jar and the libJar task; the former is now dropped entirely.

Signed-off-by: Francis Galiegue <[email protected]>
  • Loading branch information
fge committed May 25, 2014
1 parent 339bb1c commit defaec0
Showing 1 changed file with 5 additions and 28 deletions.
33 changes: 5 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,13 @@
*
* https://github.com/spring-projects/gradle-plugins/tree/master/propdeps-plugin
*/
buildscript {
repositories {
mavenCentral();
// maven {
// url "http://repo.springsource.org/plugins-release";
// }
}
dependencies {
classpath(group: "com.github.rholder", name: "gradle-one-jar",
version: "1.0.4");
// classpath(group: "org.springframework.build.gradle",
// name: "propdeps-plugin", version: "0.0.5");
}
};

//configure(allprojects) {
// apply(plugin: "propdeps");
// apply(plugin: "propdeps-maven");
// apply(plugin: "propdeps-idea");
// apply(plugin: "propdeps-eclipse");
//}

apply(plugin: "java");
apply(plugin: "maven");
apply(plugin: "signing");
apply(plugin: "osgi");
apply(plugin: "idea");
apply(plugin: "eclipse");
apply(plugin: "gradle-one-jar");

group = "com.github.fge";
version = "2.2.5-SNAPSHOT";
Expand Down Expand Up @@ -164,11 +142,6 @@ task javadocJar(type: Jar, dependsOn: copyDocFiles) {
from javadoc.destinationDir;
}

task fullJar(type: OneJar) {
mainClass = "com.github.fge.jsonschema.main.cli.Main";
archiveName = "jsonschema.jar";
}

/*
* Creates a jar that can be used as a library on java projects.
* This jar already includes all the dependencies.
Expand All @@ -181,11 +154,15 @@ task libJar(type: Jar, dependsOn: jar) {
with jar;
}

jar {
manifest {
attributes("Main-Class": "com.github.fge.jsonschema.main.cli.Main");
}
}
artifacts {
archives jar;
archives sourcesJar;
archives javadocJar;
archives fullJar;
archives libJar;
}

Expand Down

0 comments on commit defaec0

Please sign in to comment.