forked from steffenschaefer/gwt-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
105 lines (89 loc) · 2.69 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
task publish
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
distributionUrl = 'https://services.gradle.org/distributions/gradle-2.0-all.zip'
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}
ext {
encoding = 'UTF-8'
}
allprojects {
apply plugin: 'eclipse'
tasks.eclipse << {
File prefs = project.file('.settings/org.eclipse.core.resources.prefs');
if(!prefs.exists()) {
prefs.parentFile.mkdirs()
project.file('.settings/org.eclipse.core.resources.prefs')<< "eclipse.preferences.version=1\nencoding/<project>=$encoding\n";
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'license'
sourceCompatibility = 1.6
targetCompatibility = 1.6
license {
ext.year = Calendar.getInstance().get(Calendar.YEAR)
ext.name = 'Steffen Schaefer'
header rootProject.file('LICENSE')
}
repositories { mavenCentral() }
dependencies {
compile gradleApi()
testCompile group: 'junit', name: 'junit', version: '4.11'
}
tasks.withType(JavaCompile) {
options.encoding = rootProject.encoding
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
task javadocJar (type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}
javadoc {
options {
links 'http://www.gradle.org/docs/current/javadoc/', 'http://docs.oracle.com/javase/6/docs/api/'
}
}
group='de.richsource.gradle.plugins'
version='0.7-SNAPSHOT'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact javadocJar { classifier = 'javadoc' }
artifact sourceJar { classifier = 'sources' }
pom.withXml {
def root = asNode()
root.appendNode('packaging', 'jar')
root.appendNode('name', 'Gradle GWT plugin')
root.appendNode('description', 'Gradle plugin to support GWT related tasks.')
root.appendNode('inceptionYear', '2013')
root.appendNode('url', 'https://github.com/steffenschaefer/gwt-gradle-plugin')
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'Apache License, Version 2.0')
license.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt')
license.appendNode('distribution', 'repo')
def scm = root.appendNode('scm')
scm.appendNode('url', 'https://github.com/steffenschaefer/gwt-gradle-plugin')
scm.appendNode('connection', 'scm:git:https://github.com/steffenschaefer/gwt-gradle-plugin.git')
}
}
}
repositories {
maven {
url new File(rootProject.projectDir, 'repo').toURI()
}
}
}
rootProject.tasks.publish.dependsOn project.tasks.publish
}