-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
172 lines (142 loc) · 4.84 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.gradle.plugin-publish'
apply plugin: 'dev.gradleplugins.java-gradle-plugin'
apply plugin: 'java-gradle-plugin'
java.sourceCompatibility='VERSION_1_8'
java.targetCompatibility='VERSION_1_8'
buildscript {
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
classpath 'com.gradle.publish:plugin-publish-plugin:0.10.1'
classpath 'dev.gradleplugins:gradle-plugin-development:0.0.21'
}
repositories {
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
}
}
repositories { jcenter() }
dependencies {
implementation group: 'org.teavm', name: 'teavm-tooling', version: teavmVersion
implementation group: 'org.teavm', name: 'teavm-cli', version: teavmVersion
implementation gradleApi()
implementation localGroovy()
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.5.2'
// https://mvnrepository.com/artifact/org.hamcrest/hamcrest
testCompile group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.1.0'
testImplementation gradleTestKit()
// https://mvnrepository.com/artifact/org.junit.vintage/junit-vintage-engine
testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.5.2'
}
test {
useJUnitPlatform()
}
gradlePlugin {
pluginSourceSet project.sourceSets.main
testSourceSets project.sourceSets.test
plugins {
teavmPlugin {
id = 'io.github.zebalu.teavm-gradle-plugin'
implementationClass = 'io.github.zebalu.gradle.teavm.TeavmGradlePlugin'
}
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
from 'src/main/resources'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc.destinationDir
dependsOn javadoc
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
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 "zebalu"
name "Balázs Zaicsek"
email "[email protected]"
}
}
scm { url "https://github.com/zebalu/teavm-gradle-plugin" }
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'io.github.zebalu'
artifactId = project.name
version = version
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', 'Extend gradle with the capability of compiling bytecdoe to JavasCript.')
root.appendNode('name', 'Teavm Gradle Plugin')
root.appendNode('url', 'https://github.com/zebalu/teavm-gradle-plugin')
root.children().last() + pomConfig
}
}
}
}
bintray {
user = getPropertyOrWarn('bintray.user')
key = getPropertyOrWarn('bintray.key')
publications = ['maven']
pkg {
repo = 'releases'
name = 'teavm-gradle-plugin'
userOrg = 'zebalu'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/zebalu/gradle-aspectj'
}
}
gradlePlugin {
plugins {
teavmPlugin {
id = 'io.github.zebalu.teavm-gradle-plugin'
implementationClass = 'io.github.zebalu.gradle.teavm.TeavmGradlePlugin'
}
}
}
pluginBundle {
website = 'https://github.com/zebalu/teavm-gradle-plugin'
vcsUrl = 'https://github.com/zebalu/teavm-gradle-plugin'
description = 'TeaVM Gradle Plugin is bridge to use TeaVM with gradle and compile Java to JavaScript.'
plugins {
teavmPlugin {
displayName = 'Gradle Greeting plugin'
tags = ['teavm', 'bytecode', 'javascript', 'transpile']
}
}
mavenCoordinates {
groupId = project.groupId
artifactId = project.name
version = project.version
}
}
String getPropertyOrWarn(String propertyName) {
if ( !project.hasProperty(propertyName) ) {
logger.warn("There is no property set with name: ${propertyName}. Publication might fail.")
return 'missing'
}
return project.getProperty(propertyName)
}