-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
149 lines (135 loc) · 4.61 KB
/
build.gradle.kts
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
/*
* Amalgamation
* Copyright (C) 2021 Astrarre
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import java.net.URI
plugins {
base
`java-gradle-plugin`
`maven-publish`
signing
}
group = "io.github.astrarre.amalgamation"
version = "1.0.1.1"
extensions.getByType<JavaPluginExtension>().apply {
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
}
java {
withSourcesJar()
}
repositories {
mavenCentral()
mavenLocal()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
maven {
name = "FabricMC"
url = uri("https://maven.fabricmc.net/")
}
maven {
name = "HalfOf2"
url = uri("https://storage.googleapis.com/devan-maven/")
}
maven {
name = "MinecraftForge"
url = uri("https://files.minecraftforge.net/maven")
}
/*maven {
url = uri("https://maven.hydos.cf/releases")
}*/
maven {
url = file("$projectDir/libs").toURI()
}
/*maven {
url = uri("https://jitpack.io")
}*/
}
dependencies {
compileOnly("org.jetbrains", "annotations", "20.1.0")
implementation(gradleApi())
implementation("com.google.guava", "guava", "30.1-jre")
implementation("com.google.code.gson", "gson", "2.8.6")
implementation("org.ow2.asm", "asm-tree", "9.1")
implementation("net.fabricmc:mercury:0.2.4")
implementation("io.github.astrarre", "tiny-remapper", "1.0.3")
implementation("it.unimi.dsi:fastutil:8.5.6")
implementation("org.ow2.asm:asm-commons:9.1")
implementation("net.fabricmc:mapping-io:0.2.1")
implementation("net.fabricmc:access-widener-javaparser:3.0.0")
implementation("net.devtech:zip-io:3.2.6")
implementation("com.google.jimfs:jimfs:1.2")
compileOnly("net.fabricmc:fabric-fernflower:1.4.1")
implementation("net.fabricmc.unpick:unpick:2.2.0")
//implementation("io.github.coolmineman:trieharder:0.1.2")
implementation("brachyura:trieharder:0.2.0")
}
gradlePlugin {
plugins {
create("base") {
id = "amalgamation-base"
implementationClass = "io.github.astrarre.amalgamation.gradle.plugin.base.BaseAmalgamationGradlePlugin"
}
create("minecraft") {
id = "amalgamation-minecraft"
implementationClass = "io.github.astrarre.amalgamation.gradle.plugin.minecraft.MinecraftAmalgamationGradlePlugin"
}
}
}
tasks.withType<AbstractArchiveTask> {
from(rootProject.file("LICENSE"))
}
tasks.withType<Javadoc> {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
extensions.getByType<PublishingExtension>().apply {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
extensions.getByType<SigningExtension>().apply {
if (signatory != null) {
sign(this@create)
}
}
}
create<MavenPublication>("mavenTrolling") {
}
}
repositories {
/*maven {
val releasesRepoUrl = uri("${rootProject.buildDir}/repos/releases")
val snapshotsRepoUrl = uri("${rootProject.buildDir}/repos/snapshots")
name = "Project"
url = if (version.toString()
.endsWith("SNAPSHOT")
) snapshotsRepoUrl else releasesRepoUrl
}*/
maven {
val mavenUrl = if(project.hasProperty("maven_url")) project.property("maven_url") else ""
url = URI(mavenUrl as String)
if (mavenUrl.startsWith("http")) {
credentials {
username = if(project.hasProperty ("maven_username")) project.property("maven_username") as String else ""
password = if(project.hasProperty ("maven_password")) project.property("maven_password") as String else ""
}
}
}
}
}