-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommon.gradle
More file actions
117 lines (99 loc) · 2.43 KB
/
common.gradle
File metadata and controls
117 lines (99 loc) · 2.43 KB
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
107
108
109
110
111
112
113
114
115
116
buildscript {
repositories {
mavenCentral()
}
dependencies {
}
}
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'wrapper'
//apply plugin: 'groovy'
//apply plugin: 'idea'
//apply plugin: 'eclipse'
//apply plugin: 'nexus'
//apply plugin: 'project-report'
//apply plugin: 'jacoco'
//name = {project.directory.name}
group = 'koobe'
version = '0.0.2-SNAPSHOT'
compileJava {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
}
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
javadoc {
options.encoding = "UTF-8"
}
repositories {
mavenCentral();
}
dependencies {
testCompile 'junit:junit:4.10'
}
task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
sourceSets*.allSource*.srcDirs*.each { File srcDir ->
if (!srcDir.isDirectory()) {
println "Creating source folder: ${srcDir}"
srcDir.mkdirs()
}
}
}
tasks.withType(JavaExec){
System.properties.each { key, value ->
if (key.startsWith('SYSENV_')) {
systemProperty key.substring(7), value
}
}
}
test {
System.properties.each { key, value ->
if (key.startsWith('SYSENV_')) {
systemProperty key.substring(7), value
}
}
}
task javadocJar (type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
jar {
manifest {
attributes("Specification-Title": name, "Specification-Version": version, "Specification-Vendor": "KOOBE Inc.")
attributes("Implementation-Title": name, "Implementation-Version": version, "Implementation-Vendor": "KOOBE Inc.")
}
}
task sourceJar (type : Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives sourceJar
archives javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
}
}
repositories {
maven {
credentials {
username "koobe"
password "koobe123"
}
//url "${buildDir}/repo"
url "http://nexus.teamcollab.org/content/repositories/snapshots/"
}
}
}