/* * This file was generated by the Gradle 'init' task. * * This generated file contains a sample Java Library project to get you started. * For more details take a look at the Java Libraries chapter in the Gradle * User Manual available at https://docs.gradle.org/6.6.1/userguide/java_library_plugin.html */ plugins { // Apply the java-library plugin to add support for Java Library id 'java-library' } // Anpassungsmöglichkeiten // version = "1.0.0" group = "tk.rpjosh" def version = "1.0.0" // ----- // sourceCompatibility = 11 targetCompatibility = 11 // create a single Jar with all Dependancies // task fatJar(type: Jar) { classifier = '' manifest { attributes( 'Implementation-Title': 'installer', 'Implementation-Version': version, 'Implementation-Group': project.group, ) } archivesBaseName = "installer" from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } { exclude "META-INF/*.SF" exclude "META-INF/*.DSA" exclude "META-INF/*.RSA" } with jar } task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { manifest { attributes( 'Implementation-Title': 'installer', 'Implementation-Version': version, 'Implementation-Group': project.group, ) } classifier = 'javadoc' from javadoc.destinationDir } artifacts { archives fatJar archives sourcesJar archives javadocJar } //java { // withJavadocJar() //} // the created jar file will be copied automatically into the 01_Publish directory task copyJar(type: Copy) { from file("$buildDir/libs/installer-" + version + ".jar"), file("$buildDir/libs/installer-" + version + "-javadoc.jar"), file("$buildDir/libs/installer-" + version + "-sources.jar") into file("$buildDir/../../../01_Publish") } // build the maven repo file structure -> java doc can be used easily in eclipse task copyJarToMaven (type: Copy) { from file("$buildDir/libs/installer-" + version + ".jar"), file("$buildDir/libs/installer-" + version + "-javadoc.jar"), file("$buildDir/libs/installer-" + version + "-sources.jar") into file("$buildDir/../../../01_Publish/mavenRepo/tk/rpjosh/installer/" + version) } build.finalizedBy copyJar build.finalizedBy copyJarToMaven repositories { // Use jcenter for resolving dependencies. // You can declare any Maven/Ivy/file repository here. jcenter() } dependencies { // This dependency is exported to consumers, that is to say found on their compile classpath. api 'org.apache.commons:commons-math3:3.6.1' // Use JUnit test framework testImplementation 'junit:junit:4.12' // https://mvnrepository.com/artifact/com.github.vatbub/mslinks api group: 'com.github.vatbub', name: 'mslinks', version: '1.0.6.1' // https://mvnrepository.com/artifact/commons-io/commons-io api group: 'commons-io', name: 'commons-io', version: '2.10.0' } tasks.named('jar') { manifest { attributes( 'Implementation-Title': 'installer', 'Implementation-Version': version, 'Implementation-Group': 'tk.rpjosh', ) } }