-
-
Notifications
You must be signed in to change notification settings - Fork 60
/
build.gradle
156 lines (138 loc) · 4.76 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
plugins {
id 'eclipse'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.1'
id 'net.minecraftforge.gradleutils' version '2.+'
id 'dev.gradleplugins.groovy-gradle-plugin' version '1.6.9'
}
defaultTasks 'updateLicenses', 'build'
ext.buildType = project.hasProperty("buildType") ? buildType : 'RELEASE'
ext.buildNumber = project.hasProperty("buildNumber") ? buildNumber : '0'
ext.ciSystem = project.hasProperty("ciSystem") ? ciSystem : 'unknown'
ext.commit = project.hasProperty("commit") ? commit : 'unknown'
group = 'org.spongepowered'
version = buildType == 'SNAPSHOT' ? "$buildVersion-SNAPSHOT" : gradleutils.tagOffsetVersion
archivesBaseName = 'mixingradle'
sourceCompatibility = targetCompatibility = '1.8'
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
throw new GradleException("The use of the groovydoc task requires the Gradle JVM to be JRE 1.8; please change your Gradle JVM to 1.8")
}
repositories {
mavenCentral()
maven {
url 'https://repo.gradle.org/gradle/libs-releases-local/'
}
}
dependencies {
implementation 'com.google.guava:guava:21.0'
implementation 'org.ow2.asm:asm-tree:9.2'
}
processResources {
from 'LICENSE.txt'
duplicatesStrategy 'INCLUDE'
}
license {
ext {
name = project.name
organization = project.organization
url = project.url
}
include '**/*.groovy'
header = file('HEADER.txt')
ignoreFailures = false
}
jar {
manifest.mainAttributes (
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Title": project.name,
"Implementation-Version": project.version + "+" + ciSystem + "-b" + buildNumber + ".git-" + commit,
)
}
task groovydocJar(type: Jar, dependsOn: groovydoc) {
from groovydoc.destinationDir
archiveClassifier = 'groovydoc'
}
artifacts {
archives jar
archives groovydocJar
}
gradlePlugin {
compatibility {
minimumGradleVersion = '6.6'
}
website = 'http://www.gradle.org/'
vcsUrl = 'https://github.com/SpongePowered/MixinGradle'
plugins {
patcher {
id = 'org.spongepowered.mixin'
implementationClass = 'org.spongepowered.asm.gradle.plugins.MixinGradlePlugin'
displayName = 'SpongePowered Mixin Gradle Plugin'
description = 'Gradle plugin for SpongePowered Mixin'
tags.addAll('spongepowered', 'sponge', 'mixin')
}
}
automatedPublishing = true
}
publishing {
publications {
pluginMaven(MavenPublication) {
// Automated publishing declares the java component for us
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
pom {
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:git@github.com: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'
}
}
}
}
}
repositories {
if (buildType == 'RELEASE') {
if (project.hasProperty("releaseRepo")) {
maven {
credentials {
username = project.releaseRepoUsername
password = project.releaseRepoPassword
}
url project.releaseRepo
}
}
if (project.hasProperty("spongeReleaseRepo")) {
maven {
credentials {
username = project.spongeUsername
password = project.spongePassword
}
url project.spongeReleaseRepo
}
}
} else if (project.hasProperty("spongeSnapshotRepo")) {
maven {
credentials {
username = project.spongeUsername
password = project.spongePassword
}
url project.spongeSnapshotRepo
}
}
}
}