-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathbuild-old.gradle
106 lines (96 loc) · 2.79 KB
/
build-old.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
group 'info.xiancloud'
version '0.1-SNAPSHOTS'
repositories {
/*maven {
url "${nexusRemoteUrl}/repository/maven-central/"
}
maven {
url "${nexusRemoteUrl}/repository/maven-releases/"
}*/
jcenter()
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
if (project.path != ':xian-core') {
compile project(':xian-core')
} else {
compile group: 'io.netty', name: 'netty-all', version: '4.1.9.Final'
compile group: 'com.google.guava', name: 'guava', version: '21.0'
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.38'
}
}
/*
use standard maven directory structure instead!
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'res'
}
}
test {
java {
srcDir('test')
}
resources {
srcDir 'test/res'
}
}
}*/
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
//将jar包发布到私库
install {
repositories {
mavenDeployer {
repository(url: "${nexusUrl}/repository/maven-releases/") {
authentication(userName: nexusUsername, password: nexusPassword)
}
}
}
}
task copyPlugins(type: Sync) {
from configurations.runtime
into 'plugins'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
configurations {
/*'我们使用netty-all,exclude掉其他所有netty版本的包'*/
compile.exclude module: 'netty'
compile.exclude module: 'c3p0'
compile.exclude group: 'com.mchange', module: 'mchange-commons-java'
}
if (project.file('WebRoot').exists()) {
println 'web detected:' + project.name
apply plugin: 'war'
dependencies {
/*providedRuntime group: 'info.xiancloud', name: 'xian-core', version: "${xianVersion}"*/
providedRuntime project(':xian-core')
}
configurations {
war {
archiveName 'web.war' // here we give the fixed archive name.
from 'WebRoot'
//We fix the web root name as 'WebRoot', whoever uses this xian framework's web plugin must obey it.
}
}
artifacts {
war tasks.war
}
}
}