-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
99 lines (78 loc) · 1.9 KB
/
build.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
buildscript {
repositories {
mavenCentral()
}
dependencies {
project(":json");
}
}
group 'com.yangxiaochen.examples'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}
//task initializeDatabase
//initializeDatabase << { println 'connect to database' }
//initializeDatabase << { println 'update database schema' }
//initializeDatabase { print 'configuring ' }
//initializeDatabase { println 'database connection' }
task jar_product(type: Jar) {
println project.name;
println project.getArtifacts().dump()
println this.getResources().dump()
sourceSets.getByName("main").getResources().forEach { file->
println file.canonicalPath
}
println sourceSets.getRules()
from sourceSets.getByName("main").getOutput()
from "src/main/resources_local"
doLast {
println "last1"
}
}
jar {
doLast {
println "last2"
}
}
test.enabled = false
/**
* upload jar
*/
uploadArchives {
repositories {
mavenDeployer {
repository(url: "http://localhost:8081/repository/yxc023-releases") {
authentication(userName: "yxc023",password :"123456")
}
snapshotRepository(url: "http://localhost:8081/repository/yxc023-snapshots/") {
authentication(userName: "yxc023",password :"123456")
}
}
}
}
/**
* archives source
*/
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives sourcesJar
}
apply plugin: GreetingPlugin
class GreetingPlugin implements Plugin<Project> {
void apply(Project project) {
project.task('hello').doLast {
println "Hello from the GreetingPlugin"
}
}
}