-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
152 lines (134 loc) · 4.14 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
plugins {
id 'java-library'
id 'idea'
id 'signing'
id 'maven-publish'
}
allprojects {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
group projGroupId
version = projVersion
repositories {
mavenCentral()
// temporary maven repositories
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases' }
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
}
}
archivesBaseName = projArtifactId
dependencies {
api platform('org.lwjgl:lwjgl-bom:3.3.0')
api 'org.lwjgl:lwjgl'
api 'org.lwjgl:lwjgl-glfw'
api "org.lwjgl:lwjgl-jemalloc"
api 'org.lwjgl:lwjgl-opengl'
api 'org.lwjgl:lwjgl-stb'
api 'org.joml:joml:1.10.3'
api 'it.unimi.dsi:fastutil:8.5.6'
api 'com.google.code.gson:gson:2.8.9'
def nativeAttrib = [
'linux-arm32', 'linux-arm64', 'linux',
'macos-arm64', 'macos',
'windows-arm64', 'windows-x86', 'windows'
]
for (def attrib : nativeAttrib) {
runtimeOnly "org.lwjgl:lwjgl::natives-$attrib"
runtimeOnly "org.lwjgl:lwjgl-jemalloc::natives-$attrib"
runtimeOnly "org.lwjgl:lwjgl-glfw::natives-$attrib"
runtimeOnly "org.lwjgl:lwjgl-opengl::natives-$attrib"
runtimeOnly "org.lwjgl:lwjgl-stb::natives-$attrib"
}
compileOnly 'org.jetbrains:annotations:23.0.0'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
jar {
manifestContentCharset 'utf-8'
metadataCharset 'utf-8'
from 'LICENSE', 'changelog.txt'
manifest.attributes(
'Specification-Title': projName,
'Specification-Vendor': 'Overrun Organization',
'Specification-Version': '0',
'Implementation-Title': projName,
'Implementation-Vendor': 'Overrun Organization',
'Implementation-Version': archiveVersion
)
}
javadoc {
failOnError = false
options.encoding 'UTF-8'
options.charSet 'UTF-8'
options.author true
options.links 'https://docs.oracle.com/en/java/javase/17/docs/api/'
options.windowTitle "TEPv3 $projVersion Javadoc"
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set 'sources'
from sourceSets.main.allSource, 'LICENSE', 'changelog.txt'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set 'javadoc'
from javadoc, 'LICENSE', 'changelog.txt'
}
artifacts {
archives javadocJar, sourcesJar
}
java {
withJavadocJar()
withSourcesJar()
}
publishing.publications {
mavenJava(MavenPublication) {
groupId = projGroupId
artifactId = projArtifactId
version = projVersion
description = projDesc
from components.java
pom {
name = projName
description = projDesc
url = "https://github.com/$projVcs"
licenses {
license {
name = 'The MIT License'
url = "https://raw.githubusercontent.com/$projVcs/$projBranch/LICENSE"
}
}
developers {
developer {
id = 'squid233'
name = 'squid233'
email = '[email protected]'
}
}
scm {
connection = "https://github.com/${projVcs}.git"
developerConnection = "https://github.com/${projVcs}.git"
url = "https://github.com/$projVcs"
}
}
}
}
// You should add 'OSSRH_USERNAME' and 'OSSRH_PASSWORD'
// to environment path
// You should add 'signing.keyId', 'signing.password'
// and 'signing.secretKeyRingFile'
// to GRADLE_USER_HOME/gradle.properties
publishing.repositories {
maven {
name = "OSSRH"
credentials {
username System.getenv("OSSRH_USERNAME")
password System.getenv("OSSRH_PASSWORD")
}
url = version.endsWith('-SNAPSHOT')
? 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
: 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
}
}
signing {
sign publishing.publications.mavenJava
}
idea.module.inheritOutputDirs = true