38 lines
910 B
Groovy
38 lines
910 B
Groovy
plugins {
|
||
id 'java'
|
||
}
|
||
|
||
group 'com.gamecommon'
|
||
version '1.0.0-SNAPSHOT'
|
||
|
||
sourceCompatibility = 1.8
|
||
|
||
repositories {
|
||
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
|
||
mavenLocal()
|
||
mavenCentral()
|
||
}
|
||
|
||
dependencies {
|
||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||
compile group: 'com.googlecode.protobuf-java-format', name: 'protobuf-java-format', version: '1.2'
|
||
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
|
||
compile("com.google.protobuf:protobuf-java:2.5.0")
|
||
}
|
||
jar {
|
||
baseName = 'gamecommon'
|
||
}
|
||
//依赖编译,然后打包JAR
|
||
task taskJar(type:Jar, dependsOn: compileJava) {
|
||
from 'build/classes/main'
|
||
destinationDir = file('build/libs')
|
||
}
|
||
//删除lib中的jar
|
||
task clearJars(type:Delete){
|
||
delete 'lib'
|
||
}
|
||
|
||
task copyJars(type: Copy, dependsOn:clearJars) {
|
||
from configurations.runtime
|
||
into 'lib' // 目标位置
|
||
} |