|
|
@ -1,15 +1,22 @@ |
|
|
|
apply plugin: 'java' |
|
|
|
apply plugin: 'java' |
|
|
|
|
|
|
|
apply plugin: 'maven-publish' |
|
|
|
|
|
|
|
def classesDir='build/classes/main' |
|
|
|
tasks.withType(JavaCompile){ |
|
|
|
tasks.withType(JavaCompile){ |
|
|
|
options.encoding = 'UTF-8' |
|
|
|
options.encoding = 'UTF-8' |
|
|
|
destinationDir = file('build/classes/main') |
|
|
|
destinationDir = file(classesDir) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
configurations.all { |
|
|
|
|
|
|
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' |
|
|
|
} |
|
|
|
} |
|
|
|
//指定构建的jdk版本 |
|
|
|
//指定构建的jdk版本 |
|
|
|
sourceCompatibility=1.5 |
|
|
|
sourceCompatibility=1.5 |
|
|
|
def jarname="fine-third-10.0.jar" |
|
|
|
|
|
|
|
def classesDir='build/classes/main' |
|
|
|
|
|
|
|
//解压lib下的jar到classes文件夹 |
|
|
|
//解压lib下的jar到classes文件夹 |
|
|
|
|
|
|
|
|
|
|
|
jar{ |
|
|
|
jar{ |
|
|
|
baseName="fine-third-10.0" |
|
|
|
baseName="fine-third-${version}" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
repositories { |
|
|
|
repositories { |
|
|
@ -28,10 +35,13 @@ sourceSets{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取什么分支名 |
|
|
|
//获取什么分支名 |
|
|
|
FileTree files =fileTree(dir:'./',include:'build.*.gradle') |
|
|
|
FileTree files =fileTree(dir:'./',include:'build*.gradle') |
|
|
|
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator)) |
|
|
|
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator)) |
|
|
|
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) |
|
|
|
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) |
|
|
|
|
|
|
|
version='10.0' |
|
|
|
def srcDir="." |
|
|
|
def srcDir="." |
|
|
|
|
|
|
|
def maven_version="${version}-RELEASE-SNAPSHOT" |
|
|
|
|
|
|
|
def jar_version = version |
|
|
|
|
|
|
|
|
|
|
|
configurations { |
|
|
|
configurations { |
|
|
|
thirdjar |
|
|
|
thirdjar |
|
|
@ -39,12 +49,34 @@ configurations { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dependencies { |
|
|
|
dependencies { |
|
|
|
thirdjar "com.fr.third:fine-third:10.0-FEATURE-SNAPSHOT" |
|
|
|
thirdjar "com.fr.third:fine-third:10.0-RELEASE-SNAPSHOT" |
|
|
|
sigar "com.fr.third:sigar:1.6.0" |
|
|
|
sigar "com.fr.third:sigar:1.6.0" |
|
|
|
testCompile 'junit:junit:4.12' |
|
|
|
testCompile 'junit:junit:4.12' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
publishing { |
|
|
|
|
|
|
|
publications { |
|
|
|
|
|
|
|
third(MavenPublication) { |
|
|
|
|
|
|
|
groupId "com.fr.third" |
|
|
|
|
|
|
|
artifactId "fine-third" |
|
|
|
|
|
|
|
version maven_version |
|
|
|
|
|
|
|
from components.java |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
repositories { |
|
|
|
|
|
|
|
maven { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
url "http://mvn.finedevelop.com/repository/fanruan/" |
|
|
|
|
|
|
|
credentials { |
|
|
|
|
|
|
|
username = findProperty("NEXUS_USERNAME") |
|
|
|
|
|
|
|
password = findProperty("NEXUS_PASSWORD") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
task unpack(type:Copy) { |
|
|
|
task unpack(type:Copy) { |
|
|
|
delete classesDir |
|
|
|
delete classesDir |
|
|
|
destinationDir=file(classesDir) |
|
|
|
destinationDir=file(classesDir) |
|
|
|