forked from yissachar/putnami-pwt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
138 lines (116 loc) · 3.27 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
maven (){ url 'http://repo.putnami.org' }
mavenCentral()
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.4-PWT_patched'
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.7.0'
}
}
task publishAll
task publishAllToMavenLocal
task publishAllLibs
task publishAllLibsToMavenLocal
task licenseAll
task licenseFormatAll
ext {
releaseVersion = '1.0.0-RC2'
snapshotVersion = '1.0.0-SNAPSHOT'
gwtVersion = '2.6.1'
guavaVersion = '17.0'
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'
apply plugin: 'license'
apply plugin: 'gwt-base'
group = 'fr.putnami.pwt'
version = rootProject.snapshotVersion
sourceCompatibility = 1.7
targetCompatibility = 1.7
eclipse {
classpath {
downloadSources=true
}
}
configurations {
log4j
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
log4j 'org.slf4j:slf4j-api:1.6.1'
log4j 'org.slf4j:jcl-over-slf4j:1.6.1'
log4j 'org.slf4j:slf4j-log4j12:1.6.1'
log4j 'log4j:log4j:1.2.16'
compile "com.google.guava:guava:$guavaVersion"
compile "com.google.guava:guava-gwt:$guavaVersion"
runtime configurations.log4j
testCompile 'junit:junit:4.+'
}
license {
skipExistingHeaders = true
header rootProject.file('LICENSE_HEADER')
ext.projectName = project.name
}
publishing {
repositories {
maven {
url new File(rootProject.buildDir, 'repo').toURI()
}
}
publications {
mavenJava(MavenPublication) {
pom.withXml {
// Keep the 'compile' scope of the dependencies
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
asNode().appendNode('inceptionYear', '2014')
def license = asNode().appendNode('licenses').appendNode('license')
license.appendNode('name', 'GNU Lesser General Public License')
license.appendNode('url', 'http://www.gnu.org/licenses/lgpl-3.0.html')
}
}
}
}
gwt {
gwtVersion = rootProject.gwtVersion
eclipse{
addGwtContainer=false
}
}
project.tasks.publish.dependsOn project.tasks.licenseFormat
project.tasks.publishToMavenLocal.dependsOn project.tasks.licenseFormat
rootProject.tasks.publishAll.dependsOn project.tasks.publish
rootProject.tasks.publishAllToMavenLocal.dependsOn project.tasks.publishToMavenLocal
rootProject.tasks.licenseAll.dependsOn project.tasks.license
rootProject.tasks.licenseFormatAll.dependsOn project.tasks.licenseFormat
}
configure(subprojects.findAll { it.name != 'pwt-doc' } ){
//Include all non java (like *.gwt.xml) files from 'src/main/java' folder in resources
sourceSets.main.resources.srcDir 'src/main/java'
// Add all sources in jar (needed for GWT compilation using this library
jar {
from sourceSets.main.allJava
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
rootProject.tasks.publishAllLibs.dependsOn project.tasks.publish
rootProject.tasks.publishAllLibsToMavenLocal.dependsOn project.tasks.publishToMavenLocal
}