-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
128 lines (112 loc) · 3.25 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
group 'org.flakor.jpp'
version '0.1.1'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
}
}
apply plugin: 'com.jfrog.bintray'
apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'maven-publish'
sourceSets {
main {
groovy {
srcDirs = ['src/main/groovy']
}
java { srcDirs = []} //no source dirs for the java compiler
}
}
repositories {
jcenter()
}
dependencies {
compile "org.codehaus.groovy:groovy-all:2.3.11"
compile gradleApi()
testCompile group: 'junit', name: 'junit', version: '4.11'
}
compileGroovy {
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
}
def javaApiUrl = 'http://docs.oracle.com/javase/1.7.0/docs/api/'
def groovyApiUrl = 'http://groovy.codehaus.org/gapi/'
tasks.withType(Javadoc) {
options.links(javaApiUrl, groovyApiUrl)
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "steve"
name "Steve Hsu"
email "[email protected]"
}
}
}
task createReleasePropertiesFile(type:Exec) {
String fileName = 'jpp.plugin.release.properties'
println 'Creating $fileName'
String fileContent = "version=0.1.1"
(new File("$rootDir/src/main/resources/$fileName")).write(fileContent)
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId 'org.flakor.jpp'
artifactId 'gradle-jpp-plugin'
version '0.1.1'
pom.withXml {
def root = asNode()
root.appendNode('description', 'A gradle plugin for preprocess java source code with macros')
root.children().last() + pomConfig
}
}
}
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['mavenJava']
pkg {
repo = 'maven'
name = 'gradle-jpp-plugin'
userOrg = user
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/sainthsu/gradle-jpp-plugin.git'
labels = ['jpp', 'jPreprocessor', 'gradle-jpp-plugin']
publicDownloadNumbers = true
version {
name = '0.1.1'
desc = 'Gradle JPP Plugin 0.1.1'
vcsTag = '0.1.1'
attributes = ['gradle-plugin': 'jpp:org.flakor.jpp:org.flakor.jpp.gradle:jPreprocessor:gradle-jpp-plugin']
}
}
}
task install(dependsOn: 'publishMavenJavaPublicationToMavenLocal') << {
logger.info "Installing $project.name"
}
task wrapper(type: Wrapper, description: 'Gradle Wrapper task') {
gradleVersion = '2.2'
}