plugins { id 'application' id 'java' id 'com.github.hierynomus.license' version '0.14.0' } apply plugin: 'maven-publish' // to provide "gradlew publishToMavenLocal" allprojects { version = '2.1.3-SNAPSHOT' // DO NOT EDIT - THIS IS CHANGED BY THE RELEASE SCRIPT group = 'com.github.dialogos-project' repositories { mavenCentral() jcenter() maven { url "https://jitpack.io/" } mavenLocal() } apply plugin: 'java' sourceCompatibility = '1.8' apply plugin: 'license' licenseMain.onlyIf { project.file('LICENSE ').exists() } licenseTest.onlyIf { project.file('LICENSE ').exists() } dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' } } dependencies { compile subprojects } mainClassName = 'com.clt.dialogos.DialogOS' run { systemProperties System.getProperties() } def version = '2.1.3-SNAPSHOT' // DO NOT EDIT - THIS IS CHANGED BY THE RELEASE SCRIPT def group = "com.github.dialogos-project" // configuration for maven-publish plugin publishing { publications { maven(MavenPublication) { groupId = 'com.github.dialogos-project' artifactId = 'dialogos' from components.java artifact javadocJar } } } subprojects{ publishing { publications { "$project.name"(MavenPublication) { groupId = 'com.github.dialogos-project' artifactId = project.name from components.java } } } } // generate Javadoc for all subprojects and collect them together task allJavadoc(type: Javadoc) { source subprojects.collect { it.sourceSets.main.allJava } classpath = files(subprojects.collect { it.sourceSets.main.compileClasspath }) destinationDir = file("${buildDir}/docs/javadoc") } // package Javadoc into one Jar file in build/libs task javadocJar(type: Jar, dependsOn: allJavadoc) { classifier = 'javadoc' from javadoc.destinationDir } task clean_all { subprojects.each { it.afterEvaluate { def cleanTask = it.tasks.findByName('clean') if (cleanTask) { dependsOn(cleanTask) } } } } task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } // NB This is to declare artifacts for Gradle. To make the artifacts // appear on Jitpack, they also need to be declared in "publishing" above. artifacts { archives javadocJar } /**************************************** * Collect all submodules and external dependencies into a single build/libs/dialogos-with-dependencies-.jar * https://discuss.gradle.org/t/how-to-get-gradle-install-to-actually-bundle-all-project-subproject-classes-resources-etc/12070/4 ****************************************/ // This should not interfere with the distribution process, but let's // keep an eye on it. - AK configurations { childJars } dependencies { subprojects.each { childJars project(it.path) } } task shadowJar(type:Jar) { manifest { attributes 'Implementation-Title': 'DialogOS', 'Implementation-Version': version, 'Main-Class': mainClassName } baseName = 'dialogos-with-dependencies' dependsOn configurations.childJars from { configurations.childJars.collect { zipTree(it) } } }