-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild.gradle
More file actions
119 lines (103 loc) · 3.43 KB
/
build.gradle
File metadata and controls
119 lines (103 loc) · 3.43 KB
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
buildscript {
repositories {
maven { url 'https://files.minecraftforge.net/maven' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.3.72'
id 'org.jetbrains.dokka' version '0.10.1'
id 'maven-publish'
id 'java-library'
}
apply(plugin: "net.minecraftforge.gradle")
String packagesToken = new String(package_public_token.decodeBase64())
version = module_version
group = "com.projectessentials.permissions"
archivesBaseName = module_name
minecraft {
mappings channel: forge_mappings_channel_type, version: forge_mappings_channel_version
}
repositories {
maven {
name = package_maven_repo_name
url = uri "$package_maven_repo-core"
credentials {
username = package_maven_repo_mail
password = packagesToken
}
}
maven { url 'https://libraries.minecraft.net' }
maven { url 'https://maven.enginehub.org/repo' }
mavenCentral()
jcenter()
}
dependencies {
minecraft "net.minecraftforge:forge:$forge_version"
implementation("com.projectessentials.core:ProjectEssentials-Core:$core_version") {
transitive = false
}
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlinx_serialization_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-$kotlin_jdk_version_target:$kotlin_version"
implementation "com.sk89q.worldedit:worldedit-forge-mc1.14.4:7.1.0"
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/libs/docs"
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task dokkaJar(type: Jar) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
classifier = "javadoc"
from tasks.dokka as Object
}
jar {
manifest {
attributes([
"Specification-Title" : module_name,
"Specification-Vendor" : module_vendor,
"Specification-Version" : module_version,
"Implementation-Title" : module_name,
"Implementation-Version" : module_version,
"Implementation-Vendor" : module_vendor,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
project.tasks["jar"].dependsOn(project.tasks["dokka"])
sourceCompatibility = targetCompatibility =
compileJava.sourceCompatibility =
compileJava.targetCompatibility = project_jvm_version_target
compileKotlin.kotlinOptions.jvmTarget =
compileTestKotlin.kotlinOptions.jvmTarget = project_jvm_version_target
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri "https://maven.pkg.github.com/projectessentials/projectessentials-permissions"
credentials {
username = System.getenv("GradleUser")
password = System.getenv("GradlePass")
}
}
}
publications {
gpr(MavenPublication) {
version = (module_version as String).split('\\+')[0]
from components.java
artifact sourcesJar
artifact dokkaJar
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn'
}
}