-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
127 lines (105 loc) · 4.02 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
/*
* FlintMC
* Copyright (C) 2020-2021 LabyMedia GmbH and contributors
*
* 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.
*/
fun RepositoryHandler.flintRepository() {
var distributorUrl = System.getenv("FLINT_DISTRIBUTOR_URL")
if (distributorUrl == null) {
distributorUrl = project.properties.getOrDefault(
"net.flintmc.distributor.url",
"https://dist.labymod.net"
).toString()
}
if(distributorUrl.endsWith('/')) {
distributorUrl = distributorUrl.substringBeforeLast('/')
}
distributorUrl += "/api/v1/maven/release"
var bearerToken = System.getenv("FLINT_DISTRIBUTOR_BEARER_TOKEN")
if (bearerToken == null) {
bearerToken = project.properties["net.flintmc.distributor.bearer-token"].toString()
}
maven {
setUrl(distributorUrl)
name = "Flint"
if(bearerToken != null) {
authentication {
create<HttpHeaderAuthentication>("header")
}
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "Bearer $bearerToken"
}
}
}
}
plugins {
id("java-gradle-plugin")
`kotlin-dsl`
id("maven-publish")
id("org.cadixdev.licenser") version "0.6.0"
}
group = "net.flintmc"
repositories {
mavenLocal()
flintRepository()
mavenCentral()
}
version = System.getenv().getOrDefault("VERSION", "2.12.0")
dependencies {
implementation(group = "com.fasterxml.jackson.core", name = "jackson-core", version = "2.11.1")
implementation(group = "com.fasterxml.jackson.core", name = "jackson-databind", version = "2.11.1")
implementation(group = "com.fasterxml.jackson.core", name = "jackson-annotations", version = "2.11.1")
implementation(group = "com.squareup.okhttp3", name = "okhttp", version = "4.10.0-RC1")
implementation(group = "io.github.java-diff-utils", name = "java-diff-utils", version = "4.7")
implementation(group = "com.fasterxml.jackson.core", name = "jackson-core", version = "2.12.0-rc1")
implementation(group = "net.flintmc.installer", name = "logic-implementation", version = "2.0.2")
implementation(group = "net.flintmc.installer", name = "frontend-gui", version = "2.0.2")
implementation(group = "net.flintmc.installer", name = "logic", version = "2.0.2")
implementation(group = "net.flintmc.installer", name = "logic-implementation", version = "2.0.2")
implementation(group = "net.flintmc.installer", name = "logic", version = "2.0.2")
implementation(group = "org.ow2.asm", name = "asm", version = "9.1")
implementation(group = "org.ow2.asm",name = "asm-tree", version = "9.1")
implementation(group = "org.ow2.asm", name ="asm-commons", version = "9.1")
implementation(group = "com.cloudbees", name = "diff4j", version = "1.2")
}
gradlePlugin {
plugins {
create("FlintGradle") {
id = "net.flintmc.flint-gradle"
implementationClass = "net.flintmc.gradle.FlintGradlePlugin"
}
}
}
publishing {
repositories {
flintRepository()
}
}
java {
withSourcesJar()
withJavadocJar()
}
license {
header(rootProject.file("LICENSE-HEADER"))
include("**/*.java")
include("**/*.kts")
tasks {
create("gradle") {
files(project.files("build.gradle.kts", "settings.gradle.kts"))
}
}
}