diff --git a/build.third_step0.gradle b/build.third_step0.gradle index b847efe06..4621f51c5 100644 --- a/build.third_step0.gradle +++ b/build.third_step0.gradle @@ -71,26 +71,16 @@ configurations { essential } -// 主体代码与CBB的对应关系 -String essentialBranch -switch (branchNameUpperCase) { - case "FEATURE": - case "RESEARCH": - essentialBranch = "FEATURE" - break - case "RELEASE": - case "BUGFIX": - essentialBranch = "RELEASE" - break - default: - essentialBranch = "MASTER" -} - -dependencies { - essential "com.fr.essential:fine-essential:1.0-${essentialBranch}-SNAPSHOT" - essential "com.fr.cbb:fine-scheduler:1.0-${essentialBranch}-SNAPSHOT" - essential "com.fr.cbb:fine-function:1.0-${essentialBranch}-SNAPSHOT" - essential "com.fr.cbb:fine-sql:1.0-${essentialBranch}-SNAPSHOT" +// 主体代码与essential的对应关系配置在TeamCity +String essentialVersion = findProperty("essentialVersion") +String cbbVersion = findProperty("cbbVersion") + +//指定依赖 +dependencies{ + essential "com.fr.essential:fine-essential:${essentialVersion}" + essential "com.fr.cbb:fine-scheduler:${cbbVersion}" + essential "com.fr.cbb:fine-function:${cbbVersion}" + essential "com.fr.cbb:fine-sql:${cbbVersion}" // thirdjar "com.fr.third:fine-third-base:10.0-BASE-SNAPSHOT" // sigar "com.fr.third:sigar:1.6.0" testCompile 'junit:junit:4.12' @@ -109,7 +99,7 @@ publishing { third_build(MavenPublication) { groupId "com.fr.third" - artifactId "fine-third" + artifactId project.hasProperty("withCBB") ? "fine-third" : "fine-third-without-cbb" version maven_version_build ext.repo = 'snapshot' from components.java @@ -179,12 +169,14 @@ task unpack(type:Copy) { // 将essential依赖等级的jar全部解压到classes下 task unpackEssential(type:Copy) { - for (File file : configurations.essential.files) { - from zipTree(file) + if (project.hasProperty("withCBB")) { + for (File file : configurations.essential.files) { + from zipTree(file) + } + into classesDir } - into classesDir } unpackEssential.dependsOn unpack -jar.dependsOn unpackEssential +jar.dependsOn unpackEssential \ No newline at end of file diff --git a/build.third_step2.gradle b/build.third_step2.gradle index eedad3992..0c4711639 100644 --- a/build.third_step2.gradle +++ b/build.third_step2.gradle @@ -70,24 +70,12 @@ if(indexV != -1){ version= branchName } -// 主体代码与CBB的对应关系 -String essentialBranch -switch (version) { - case "FEATURE": - case "RESEARCH": - essentialBranch = "FEATURE" - break - case "RELEASE": - case "BUGFIX": - essentialBranch = "RELEASE" - break - default: - essentialBranch = "MASTER" -} +// 主体代码与essential的对应关系配置在TeamCity +String essentialVersion = findProperty("essentialVersion") //指定依赖 dependencies{ - compileOnly "com.fr.essential:fine-essential:1.0-${essentialBranch}-SNAPSHOT" + compileOnly "com.fr.essential:fine-essential:${essentialVersion}" compile fileTree(dir:"${srcDir}/fine-byte-buddy/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-commons-fileupload/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-httpcomponents/http-client/lib",include:'**/*.jar') diff --git a/build.third_step3.gradle b/build.third_step3.gradle index c8d5fd0f3..ed1dd9f61 100644 --- a/build.third_step3.gradle +++ b/build.third_step3.gradle @@ -53,25 +53,12 @@ if(indexV != -1){ version= branchName } -// 主体代码与CBB的对应关系 -String essentialBranch -switch (version) { - case "FEATURE": - case "RESEARCH": - essentialBranch = "FEATURE" - break - case "RELEASE": - case "BUGFIX": - essentialBranch = "RELEASE" - break - default: - essentialBranch = "MASTER" -} - +// 主体代码与essential的对应关系配置在TeamCity +String essentialVersion = findProperty("essentialVersion") //指定依赖 dependencies{ - compileOnly "com.fr.essential:fine-essential:1.0-${essentialBranch}-SNAPSHOT" + compileOnly "com.fr.essential:fine-essential:${essentialVersion}" compile fileTree(dir:"${srcDir}/fine-jboss-logging/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:System.getenv("JAVA_HOME"),include:"lib/tools.jar") diff --git a/build.third_step4.gradle b/build.third_step4.gradle index 121b687ca..3f430a887 100644 --- a/build.third_step4.gradle +++ b/build.third_step4.gradle @@ -53,24 +53,12 @@ if(indexV != -1){ version= branchName } -// 主体代码与CBB的对应关系 -String essentialBranch -switch (version) { - case "FEATURE": - case "RESEARCH": - essentialBranch = "FEATURE" - break - case "RELEASE": - case "BUGFIX": - essentialBranch = "RELEASE" - break - default: - essentialBranch = "MASTER" -} +// 主体代码与essential的对应关系配置在TeamCity +String essentialVersion = findProperty("essentialVersion") //指定依赖 dependencies{ - compileOnly "com.fr.essential:fine-essential:1.0-${essentialBranch}-SNAPSHOT" + compileOnly "com.fr.essential:fine-essential:${essentialVersion}" // compile fileTree(dir:"${srcDir}/fine-hibernate/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-spring/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') diff --git a/build.third_step5.gradle b/build.third_step5.gradle index 454eb20bb..03ed8a2e2 100644 --- a/build.third_step5.gradle +++ b/build.third_step5.gradle @@ -53,24 +53,12 @@ if(indexV != -1){ version= branchName } -// 主体代码与CBB的对应关系 -String essentialBranch -switch (version) { - case "FEATURE": - case "RESEARCH": - essentialBranch = "FEATURE" - break - case "RELEASE": - case "BUGFIX": - essentialBranch = "RELEASE" - break - default: - essentialBranch = "MASTER" -} +// 主体代码与essential的对应关系配置在TeamCity +String essentialVersion = findProperty("essentialVersion") //指定依赖 dependencies{ - compileOnly "com.fr.essential:fine-essential:1.0-${essentialBranch}-SNAPSHOT" + compileOnly "com.fr.essential:fine-essential:${essentialVersion}" compile fileTree(dir:"${srcDir}/fine-hibernate/lib",include:'**/*.jar') // compile fileTree(dir:"${srcDir}/fine-spring/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') diff --git a/build.third_step6.gradle b/build.third_step6.gradle index 335bfa469..efb858d21 100644 --- a/build.third_step6.gradle +++ b/build.third_step6.gradle @@ -51,24 +51,12 @@ if(indexV != -1){ version= branchName } -// 主体代码与CBB的对应关系 -String essentialBranch -switch (version) { - case "FEATURE": - case "RESEARCH": - essentialBranch = "FEATURE" - break - case "RELEASE": - case "BUGFIX": - essentialBranch = "RELEASE" - break - default: - essentialBranch = "MASTER" -} +// 主体代码与essential的对应关系配置在TeamCity +String essentialVersion = findProperty("essentialVersion") //指定依赖 dependencies{ - compileOnly "com.fr.essential:fine-essential:1.0-${essentialBranch}-SNAPSHOT" + compileOnly "com.fr.essential:fine-essential:${essentialVersion}" compile fileTree(dir:"${srcDir}/fine-druid/lib",include:'ojdbc7-12.1.0.jar') compile fileTree(dir:"${srcDir}/fine-druid/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-socketio/lib",include:'**/*.jar') diff --git a/build.third_step7.gradle b/build.third_step7.gradle index 004bfe121..1eba989d1 100644 --- a/build.third_step7.gradle +++ b/build.third_step7.gradle @@ -51,24 +51,12 @@ if(indexV != -1){ version= branchName } -// 主体代码与CBB的对应关系 -String essentialBranch -switch (version) { - case "FEATURE": - case "RESEARCH": - essentialBranch = "FEATURE" - break - case "RELEASE": - case "BUGFIX": - essentialBranch = "RELEASE" - break - default: - essentialBranch = "MASTER" -} +// 主体代码与essential的对应关系配置在TeamCity +String essentialVersion = findProperty("essentialVersion") //指定依赖 dependencies{ - compileOnly "com.fr.essential:fine-essential:1.0-${essentialBranch}-SNAPSHOT" + compileOnly "com.fr.essential:fine-essential:${essentialVersion}" compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:System.getenv("JAVA_HOME"),include:"lib/tools.jar") compile group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"