-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
98 lines (80 loc) · 2.22 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
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.0'
id "com.github.jruby-gradle.base" version "2.1.0-alpha.2"
id "com.github.jruby-gradle.core" version "2.1.0-alpha.2"
id "com.github.jruby-gradle.jar" version "2.1.0-alpha.1"
id 'maven-publish'
id 'java'
}
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
def ENV = System.getenv()
repositories {
mavenCentral()
maven {
url = "https://maven.fabricmc.net/"
}
}
configurations {
shade
}
dependencies {
implementation "net.fabricmc:fabric-loader:$loader_version"
shade implementation("org.jruby:jruby-complete:$jruby_version")
}
java {
withSourcesJar()
}
shadowJar {
dependsOn(jar)
configurations = [project.configurations.shade]
archiveClassifier.set('dev')
exclude 'org/objectweb/**/*'
}
build.dependsOn(shadowJar)
processResources {
inputs.property 'version', project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
jrubyJar {
initScript "${projectDir}/src/main/java/RubyAdapter.rb"
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
artifact(shadowJar)
artifact(sourcesJar)
pom.withXml {
subprojects.each {
if (it.name != project.testmods_project) {
depNode.appendNode("groupId", it.group)
depNode.appendNode("artifactId", it.name)
depNode.appendNode("version", it.version)
depNode.appendNode("scope", "compile")
}
}
}
}
}
repositories {
if (ENV.MAVEN_PUBLISH_TOKEN) {
maven {
url 'https://repo.repsy.io/mvn/distant/rubyfabric'
credentials {
username ENV.MAVEN_PUBLISH_USERNAME
password ENV.MAVEN_PUBLISH_TOKEN
}
authentication {
basic(BasicAuthentication)
}
}
}
}
}