daniel 6 years ago
parent
commit
b6d8a4cfce
  1. 44
      build.third_step0.gradle

44
build.third_step0.gradle

@ -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)

Loading…
Cancel
Save