-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
133 lines (111 loc) · 3.97 KB
/
build.gradle
File metadata and controls
133 lines (111 loc) · 3.97 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
plugins {
id "dev.donutquine.flatbuffers" version "1.0.8"
id 'java-library'
id 'maven-publish'
id 'signing'
// https://github.com/yananhub/flying-gradle-plugin
id "tech.yanand.maven-central-publish" version "1.3.0"
}
group = 'dev.donutquine'
version = project.version
repositories {
mavenCentral()
mavenLocal()
maven {
url = uri("https://maven.pkg.github.com/danila-schelkov/*")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
implementation group: 'com.google.flatbuffers', name: 'flatbuffers-java', version: project.flatbuffers_version
implementation group: 'org.slf4j', name: 'slf4j-simple', version: project.slf4j_version
implementation group: 'dev.donutquine', name: 'sc-file', version: project.sc_file_version
}
import io.netifi.flatbuffers.plugin.tasks.FlatBuffers
flatbuffers {
flatcPath = project.findProperty("flatc.path") ?: System.getenv("FLATC_PATH")
language = 'java'
}
tasks.withType(JavaCompile) {
options.release = 17
}
tasks.register('createFlatBuffers', FlatBuffers) {
inputDir = file("src/main/flatbuffers")
outputDir = file("src/generated/flatbuffers")
language = 'java'
delete outputDir
}
tasks.register("sourcesJar", Jar) {
archiveClassifier.set("sources")
from(sourceSets.main.allSource)
from(tasks.named("createFlatBuffers").get().outputs)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.register("javadocJar", Jar) {
archiveClassifier.set("javadoc")
from(tasks.javadoc)
}
tasks.named("compileJava") {
dependsOn(tasks.named("createFlatBuffers"))
}
publishing {
repositories {
// GitHub Packages
maven {
name = "github"
url = uri("https://maven.pkg.github.com/danila-schelkov/supercell-swf")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact(tasks.named("sourcesJar").get())
artifact(tasks.named("javadocJar").get())
pom {
name = "supercell-swf"
description = "A library for parsing Supercell SWF file format"
url = "https://github.com/danila-schelkov/supercell-swf"
licenses {
license {
name = "MIT License"
url = "https://opensource.org/licenses/MIT"
distribution = "repo"
}
}
developers {
developer {
id = "danila-schelkov"
name = "Danila Schelkov"
email = "me@donutquine.dev"
}
}
scm {
url = "https://github.com/danila-schelkov/supercell-swf"
connection = "scm:git:https://github.com/danila-schelkov/supercell-swf.git"
developerConnection = "scm:git:ssh://git@github.com/danila-schelkov/supercell-swf.git"
}
}
}
}
}
signing {
useInMemoryPgpKeys(
findProperty("signing.key") as String,
findProperty("signing.password") as String
)
sign publishing.publications.mavenJava
}
import java.nio.charset.StandardCharsets
mavenCentral {
def username = findProperty("sonatype.username") ?: System.getenv("SONATYPE_USERNAME")
def password = findProperty("sonatype.password") ?: System.getenv("SONATYPE_PASSWORD")
def credentials = "${username}:${password}"
authToken = credentials.getBytes(StandardCharsets.UTF_8).encodeBase64().toString()
}