Skip to content

Instantly share code, notes, and snippets.

@h1romas4
Created June 12, 2018 07:23
Show Gist options
  • Select an option

  • Save h1romas4/d7989a284e40a12b3b90b8356d7b9479 to your computer and use it in GitHub Desktop.

Select an option

Save h1romas4/d7989a284e40a12b3b90b8356d7b9479 to your computer and use it in GitHub Desktop.
Gradle multi projext example.
/**
* Gradle マルチプロジェクトの例
*
* build/build.gradle
* build/setting.gradle
*
* Application/
* Common/
* Project1/
* Project2/
*/
// build/setting.gradle
//
// includeFlat 'Application'
//
// includeFlat 'Common'
// includeFlat 'Project1'
// includeFlat 'Project2'
//
// rootProject.name = 'build'
// build/build.gradle
/**
* プロジェクト横断設定
*/
subprojects {
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceCompatibility = 1.8
targetCompatibility = 1.8
// sourceSets {
// main {
// java {
// srcDir 'src/main/java'
// }
// }
// }
dependencies {
compile fileTree(dir: '../lib', include: ['*.jar'])
// if(System.properties['os.name'].toLowerCase().contains('windows')) {
// } else {
// }
}
}
project(':Common') {
// jar {
// metaInf {
// from('src/META-INF')
// }
// }
}
project(':Project1') {
dependencies {
compile project(':Common')
}
}
project(':Project2') {
dependencies {
compile project(':Common')
}
}
project(':Application') {
apply plugin: 'war'
dependencies {
compile fileTree(dir: '../lib', include: ['*.jar'])
compile project(':Common')
compile project(':Project1')
compile project(':Project2')
}
war {
// from 'WebContent'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment