forked from SpongePowered/MixinGradle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
171 lines (150 loc) · 4.65 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
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
classpath 'com.gradle.publish:plugin-publish-plugin:0.9.1'
}
}
apply plugin: 'groovy'
apply plugin: 'license'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'com.gradle.plugin-publish'
defaultTasks 'licenseFormat', 'build'
group = 'org.spongepowered'
version = buildVersion + (buildType == 'RELEASE' ? '' : "-$buildType")
archivesBaseName = 'mixingradle'
targetCompatibility = '1.6'
sourceCompatibility = '1.6'
repositories {
mavenCentral()
maven {
url 'https://repo.gradle.org/gradle/libs-releases-local/'
}
}
configurations {
deployerJars
}
dependencies {
implementation gradleApi()
// implementation 'org.codehaus.groovy:groovy-all:2.5.8'
implementation 'com.google.guava:guava:21.0'
implementation 'org.ow2.asm:asm-tree:6.2'
deployerJars 'org.apache.maven.wagon:wagon-ftp:2.7'
}
eclipse.classpath.file.whenMerged {
entries.each {
if (it.path.contains('gradle-api') && it.sourcePath == null) {
// Source attachment doesn't currently work when using gradleApi() dependency so include manually
it.sourcePath = fileReference(file('lib/core-api.zip'))
}
}
}
processResources {
from 'LICENSE.txt'
}
license {
ext {
name = project.name
organization = project.organization
url = project.url
}
include '**/*.groovy'
header file('HEADER.txt')
sourceSets = project.sourceSets
ignoreFailures false
strictCheck true
mapping {
java = 'SLASHSTAR_STYLE'
}
}
jar {
manifest.mainAttributes (
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Title": name,
"Implementation-Version": buildVersion
)
}
/* task signJar() {
inputs.files(jar.outputs)
outputs.files(jar.outputs)
doLast {
ant.signjar(
alias: project.keyStoreCert,
jar: jar.outputs.files[0],
keystore: project.keyStorePath,
storepass: project.keyStoreSecret,
keypass: project.keyStoreSecret,
tsaurl: project.timestampAuthority,
preservelastmodified: 'true',
verbose: true
)
}
}
build.dependsOn(signJar) */
task groovydocJar(type: Jar, dependsOn: groovydoc) {
from groovydoc.destinationDir
classifier = 'groovydoc'
}
artifacts {
archives jar
archives groovydocJar
}
pluginBundle {
website = 'http://www.gradle.org/'
vcsUrl = 'https://github.com/SpongePowered/MixinGradle'
description = 'Gradle plugin for SpongePowered Mixin'
tags = ['spongepowered', 'sponge', 'mixin']
plugins {
patcher {
id = 'org.spongepowered.mixin'
displayName = 'SpongePowered Mixin Gradle Plugin'
}
}
}
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
if (project.hasProperty("spongeRepo")) {
repository(url: project.spongeRepo) {
authentication(userName: project.spongeUsername, password: project.spongePassword)
}
} else {
repository(url: 'file://' + rootProject.file('repo').getAbsolutePath())
}
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'MixinGradle'
url 'http://www.spongepowered.org/'
scm {
url 'https://github.com/SpongePowered/MixinGradle'
connection 'scm:git:git://github.com/SpongePowered/MixinGradle.git'
developerConnection 'scm:git:[email protected]:SpongePowered/MixinGradle.git'
}
issueManagement {
system 'GitHub Issues'
url 'https://github.com/SpongePowered/MixinGradle/issues'
}
licenses {
license {
name 'MIT license'
url 'http://opensource.org/licenses/MIT'
distribution 'repo'
}
}
}
}
}
}
}