buildRelease
This commit is contained in:
84
build.gradle
84
build.gradle
@@ -25,7 +25,7 @@ allprojects {
|
|||||||
configurations.all {
|
configurations.all {
|
||||||
transitive = false// 为本依赖关闭依赖传递特性
|
transitive = false// 为本依赖关闭依赖传递特性
|
||||||
}
|
}
|
||||||
//JAVA Version
|
//java Version
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
compileJava.options.encoding = 'UTF-8'
|
compileJava.options.encoding = 'UTF-8'
|
||||||
@@ -73,27 +73,12 @@ repositories {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
//apply plugin: 'org.springframework.boot'
|
//apply plugin: 'org.springframework.boot'
|
||||||
//apply plugin: 'io.spring.dependency-management'
|
//apply plugin: 'io.spring.dependency-management'
|
||||||
|
|
||||||
//项目名
|
|
||||||
println project.name
|
|
||||||
//项目相对路径
|
|
||||||
println project.path
|
|
||||||
//项目描述
|
|
||||||
println project.description
|
|
||||||
//项目的绝对路径
|
|
||||||
println project.projectDir
|
|
||||||
//项目的build文件绝对路径
|
|
||||||
println project.buildDir
|
|
||||||
//项目所在的group
|
|
||||||
println project.group
|
|
||||||
//项目的版本号
|
|
||||||
println project.version
|
|
||||||
//项目的ant对象
|
|
||||||
println project.ant
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java {
|
||||||
@@ -161,8 +146,8 @@ subprojects {
|
|||||||
compile group: 'org.apache.poi', name: 'poi-ooxml', version: "${poiVersion}"
|
compile group: 'org.apache.poi', name: 'poi-ooxml', version: "${poiVersion}"
|
||||||
compile group: 'org.apache.poi', name: 'poi-ooxml-schemas', version: "${poiVersion}"
|
compile group: 'org.apache.poi', name: 'poi-ooxml-schemas', version: "${poiVersion}"
|
||||||
compile group: 'org.apache.poi', name: 'poi-scratchpad', version: "${poiVersion}"
|
compile group: 'org.apache.poi', name: 'poi-scratchpad', version: "${poiVersion}"
|
||||||
|
compile group: 'org.apache.commons', name: 'not-yet-commons-ssl', version: '0.3.9'
|
||||||
|
|
||||||
//compile group: 'org.apache.commons', name: 'not-yet-commons-ssl', version: '0.3.9'
|
|
||||||
//logs
|
//logs
|
||||||
compile group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: "${log4jVersion}"
|
compile group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: "${log4jVersion}"
|
||||||
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4jVersion}"
|
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4jVersion}"
|
||||||
@@ -326,35 +311,16 @@ subprojects {
|
|||||||
|
|
||||||
def currentTime = java.time.ZonedDateTime.now()
|
def currentTime = java.time.ZonedDateTime.now()
|
||||||
manifest {
|
manifest {
|
||||||
attributes( "Implementation-Title": project.name,
|
attributes(
|
||||||
|
"Implementation-Title": project.name,
|
||||||
"Implementation-Vendor": project.vendor,
|
"Implementation-Vendor": project.vendor,
|
||||||
"Created-By": project.author,
|
"Created-By": project.author,
|
||||||
"Implementation-Date": currentTime,
|
"Implementation-Date": currentTime,
|
||||||
"Implementation-Version": project.version)
|
"Implementation-Version": project.version
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task checkenv{
|
|
||||||
println 'check env for project '
|
|
||||||
//项目名
|
|
||||||
println project.name
|
|
||||||
//项目相对路径
|
|
||||||
println project.path
|
|
||||||
//项目描述
|
|
||||||
println project.description
|
|
||||||
//项目的绝对路径
|
|
||||||
println project.projectDir
|
|
||||||
//项目的build文件绝对路径
|
|
||||||
println "buildDir " +project.buildDir
|
|
||||||
//项目所在的group
|
|
||||||
println project.group
|
|
||||||
//项目的版本号
|
|
||||||
println project.version
|
|
||||||
//项目的ant对象
|
|
||||||
println project.ant
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
task copyjar2Release(type: Copy) {
|
task copyjar2Release(type: Copy) {
|
||||||
println "$buildDir/libs/ to $rootDir/build/maxkey-jars/"
|
println "$buildDir/libs/ to $rootDir/build/maxkey-jars/"
|
||||||
into "$rootDir/build/maxkey-jars/"
|
into "$rootDir/build/maxkey-jars/"
|
||||||
@@ -362,11 +328,6 @@ subprojects {
|
|||||||
include '*.jar'
|
include '*.jar'
|
||||||
}
|
}
|
||||||
|
|
||||||
task copyDepJars(type: Copy){
|
|
||||||
from configurations.runtime
|
|
||||||
into "$rootDir/build/maxkey-depjars"
|
|
||||||
}
|
|
||||||
|
|
||||||
task copydemoWar2Release(type: Copy) {
|
task copydemoWar2Release(type: Copy) {
|
||||||
into "$rootDir/build/demowar/"
|
into "$rootDir/build/demowar/"
|
||||||
from "$buildDir/libs/"
|
from "$buildDir/libs/"
|
||||||
@@ -384,11 +345,36 @@ subprojects {
|
|||||||
from "$buildDir/libs/"
|
from "$buildDir/libs/"
|
||||||
}
|
}
|
||||||
|
|
||||||
task buildRelease(dependsOn:['build','jar','copyjar2Release','copyDepJars']) {
|
task buildRelease(dependsOn:['build','jar','copyjar2Release']) {
|
||||||
println 'Build MaxKey '+project.name +' complete .'
|
//项目名
|
||||||
|
println "project " + project.name + " environment ..."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//copy Dep Jars to /build/maxkey-depjars
|
||||||
|
project('maxkey-core') {
|
||||||
|
task copyDepJars(type: Copy){
|
||||||
|
println "copy Dep Jars to $rootDir/build/maxkey-depjars"
|
||||||
|
|
||||||
|
from configurations.runtime
|
||||||
|
into "$rootDir/build/maxkey-depjars"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
task buildRelease(dependsOn:['build']) {
|
||||||
|
//项目名
|
||||||
|
println "project " + project.name + " environment ..."
|
||||||
|
//项目所在的group version 版本号
|
||||||
|
println "project group " + project.group +" , version " + project.version
|
||||||
|
//项目相对路径
|
||||||
|
println "project path " + project.path
|
||||||
|
//项目的绝对路径
|
||||||
|
println "project projectDir " + project.projectDir
|
||||||
|
//项目的build文件绝对路径
|
||||||
|
println "project buildDir " + project.buildDir
|
||||||
|
println 'Build MaxKey '+project.name +' '
|
||||||
|
}
|
||||||
// In this section you declare the dependencies for your production and test code
|
// In this section you declare the dependencies for your production and test code
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
|
|||||||
11
release.bat
11
release.bat
@@ -2,24 +2,21 @@ call setEnvVars.bat
|
|||||||
|
|
||||||
set START_TIME="%date:~0,10% %time:~0,2%:%time:~3,5%"
|
set START_TIME="%date:~0,10% %time:~0,2%:%time:~3,5%"
|
||||||
echo start time %START_TIME%
|
echo start time %START_TIME%
|
||||||
|
|
||||||
call %JAVA_HOME%/bin/java -version
|
call %JAVA_HOME%/bin/java -version
|
||||||
|
|
||||||
call %GRADLE_HOME%/bin/gradle -version
|
call %GRADLE_HOME%/bin/gradle -version
|
||||||
|
|
||||||
|
call %GRADLE_HOME%/bin/gradle -q projects
|
||||||
|
|
||||||
echo start clean . . .
|
echo start clean . . .
|
||||||
|
|
||||||
call %GRADLE_HOME%/bin/gradle clean
|
call %GRADLE_HOME%/bin/gradle clean
|
||||||
|
|
||||||
echo start clean complete .
|
echo start clean complete .
|
||||||
|
|
||||||
call %GRADLE_HOME%/bin/gradle checkenv
|
|
||||||
|
|
||||||
call %GRADLE_HOME%/bin/gradle
|
|
||||||
|
|
||||||
call %GRADLE_HOME%/bin/gradle war
|
|
||||||
|
|
||||||
call %GRADLE_HOME%/bin/gradle buildRelease
|
call %GRADLE_HOME%/bin/gradle buildRelease
|
||||||
|
|
||||||
|
call %GRADLE_HOME%/bin/gradle copyDepJars
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
rd /q /s libs
|
rd /q /s libs
|
||||||
|
|||||||
Reference in New Issue
Block a user