forked from steffenschaefer/gwt-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
99 lines (83 loc) · 2.28 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
task publish
task wrapper(type: Wrapper) {
gradleVersion = '1.10'
distributionUrl = 'http://services.gradle.org/distributions/gradle-1.10-all.zip'
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.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,5.0['
}
tasks.withType(Compile) {
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.4-SNAPSHOT'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact javadocJar { classifier = 'javadoc' }
artifact sourceJar { classifier = 'sources' }
pom.withXml {
def root = asNode()
root.appendNode('name', 'Gradle GWT plugin')
root.appendNode('description', 'Gradle plugin to support GWT related tasks.')
root.appendNode('inceptionYear', '2013')
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')
}
}
}
repositories {
maven {
url new File(rootProject.projectDir, 'repo').toURI()
}
}
}
rootProject.tasks.publish.dependsOn project.tasks.publish
}