forked from fesh0r/fernflower
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
77 lines (63 loc) · 1.63 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
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
apply plugin: 'java'
apply plugin: 'maven-publish'
compileJava {
sourceCompatibility '17'
targetCompatibility '17'
}
group = 'net.fabricmc'
archivesBaseName = 'fabric-fernflower'
version = '2.0.0'
def ENV = System.getenv()
version = version + (ENV.GITHUB_ACTIONS ? "" : "+local")
sourceSets {
main.java.srcDirs 'src'
test.java.srcDirs 'test'
}
repositories { mavenCentral() }
dependencies {
implementation 'org.jetbrains:annotations:20.1.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.23.1'
}
jar {
manifest {
attributes 'Main-Class': 'org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler'
}
}
task sourceJar(type:Jar) {
classifier = "sources"
from sourceSets.main.allSource
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 17
}
java {
sourceCompatibility = JavaVersion.toVersion(17)
targetCompatibility = JavaVersion.toVersion(17)
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact(sourceJar)
}
}
// select the repositories you want to publish to
repositories {
if (ENV.MAVEN_URL) {
maven {
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USERNAME
password ENV.MAVEN_PASSWORD
}
}
}
}
}
// Dont publish module metadata to prevent gradle resolving this dep on outdated java versions.
tasks.withType(GenerateModuleMetadata) {
enabled = false
}