mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-08-03 19:36:53 -04:00
fix: not compatible with Gradle 7.0
* use api & implementation scope, instead of compile * add shadow plugin back * related: https://github.com/huanghongxun/HMCL/pull/863 * the duplicate entry bug is fixed * move dependencies from root project to HMCLCore module
This commit is contained in:
parent
eed475cb28
commit
cc087dee81
@ -1,4 +1,7 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.tukaani:xz:1.8'
|
||||
}
|
||||
@ -6,6 +9,7 @@ buildscript {
|
||||
|
||||
plugins {
|
||||
id 'application'
|
||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||
}
|
||||
|
||||
import java.nio.file.FileSystems
|
||||
@ -32,8 +36,8 @@ version = versionroot + '.' + buildnumber
|
||||
mainClassName = 'org.jackhuang.hmcl.Main'
|
||||
|
||||
dependencies {
|
||||
compile project(":HMCLCore")
|
||||
compile rootProject.files("lib/JFoenix.jar")
|
||||
implementation project(":HMCLCore")
|
||||
implementation rootProject.files("lib/JFoenix.jar")
|
||||
}
|
||||
|
||||
def digest(String algorithm, byte[] bytes) {
|
||||
@ -101,6 +105,13 @@ compileJava11Java {
|
||||
}
|
||||
|
||||
jar {
|
||||
enabled = false
|
||||
dependsOn shadowJar
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
classifier = null
|
||||
|
||||
manifest {
|
||||
attributes 'Created-By': 'Copyright(c) 2013-2020 huangyuhui.',
|
||||
'Main-Class': mainClassName,
|
||||
@ -129,18 +140,6 @@ jar {
|
||||
].join(" ")
|
||||
}
|
||||
|
||||
from {
|
||||
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
}
|
||||
|
||||
into('META-INF/versions/11') {
|
||||
from sourceSets.java11.output
|
||||
}
|
||||
|
||||
exclude 'META-INF/maven/**'
|
||||
exclude 'META-INF/NOTICE.txt'
|
||||
exclude 'META-INF/LICENSE.txt'
|
||||
|
||||
doLast {
|
||||
repack(jar.archivePath) // see repack()
|
||||
attachSignature(jar.archivePath)
|
||||
@ -171,6 +170,11 @@ processResources {
|
||||
|
||||
convertToBSS "assets/css/root.css"
|
||||
convertToBSS "assets/css/blue.css"
|
||||
|
||||
into('META-INF/versions/11') {
|
||||
from sourceSets.java11.output
|
||||
}
|
||||
dependsOn java11Classes
|
||||
}
|
||||
|
||||
task makePack(dependsOn: jar) {
|
||||
|
@ -0,0 +1,24 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
|
||||
api group: 'org.tukaani', name: 'xz', version: '1.8'
|
||||
api(group: 'org.hildan.fxgson', name: 'fx-gson', version: '3.1.0') {
|
||||
exclude group: 'org.jetbrains', module: 'annotations'
|
||||
}
|
||||
api group: 'org.jenkins-ci', name: 'constant-pool-scanner', version: '1.2'
|
||||
api group: 'com.github.steveice10', name: 'opennbt', version: '1.1'
|
||||
api group: 'com.nqzero', name: 'permit-reflect', version: '0.3'
|
||||
compileOnlyApi group: 'org.jetbrains', name: 'annotations', version: '16.0.3'
|
||||
|
||||
// compileOnlyApi group: 'org.openjfx', name: 'javafx-base', version: '15', classifier: 'win'
|
||||
// compileOnlyApi group: 'org.openjfx', name: 'javafx-controls', version: '15', classifier: 'win'
|
||||
// compileOnlyApi group: 'org.openjfx', name: 'javafx-fxml', version: '15', classifier: 'win'
|
||||
// compileOnlyApi group: 'org.openjfx', name: 'javafx-graphics', version: '15', classifier: 'win'
|
||||
// compileOnlyApi group: 'org.openjfx', name: 'javafx-media', version: '15', classifier: 'win'
|
||||
// compileOnlyApi group: 'org.openjfx', name: 'javafx-swing', version: '15', classifier: 'win'
|
||||
// compileOnlyApi group: 'org.openjfx', name: 'javafx-web', version: '15', classifier: 'win'
|
||||
|
||||
}
|
18
build.gradle
18
build.gradle
@ -25,23 +25,7 @@ subprojects {
|
||||
compileTestJava.options.encoding = "UTF-8"
|
||||
|
||||
dependencies {
|
||||
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
|
||||
compile group: 'org.tukaani', name: 'xz', version: '1.8'
|
||||
compile group: 'org.hildan.fxgson', name: 'fx-gson', version: '3.1.0'
|
||||
compile group: 'org.jenkins-ci', name: 'constant-pool-scanner', version: '1.2'
|
||||
compile group: 'com.github.steveice10', name: 'opennbt', version: '1.1'
|
||||
compile group: 'com.nqzero', name: 'permit-reflect', version: '0.3'
|
||||
compileOnly group: 'org.jetbrains', name: 'annotations', version: '16.0.3'
|
||||
|
||||
// compileOnly group: 'org.openjfx', name: 'javafx-base', version: '15', classifier: 'win'
|
||||
// compileOnly group: 'org.openjfx', name: 'javafx-controls', version: '15', classifier: 'win'
|
||||
// compileOnly group: 'org.openjfx', name: 'javafx-fxml', version: '15', classifier: 'win'
|
||||
// compileOnly group: 'org.openjfx', name: 'javafx-graphics', version: '15', classifier: 'win'
|
||||
// compileOnly group: 'org.openjfx', name: 'javafx-media', version: '15', classifier: 'win'
|
||||
// compileOnly group: 'org.openjfx', name: 'javafx-swing', version: '15', classifier: 'win'
|
||||
// compileOnly group: 'org.openjfx', name: 'javafx-web', version: '15', classifier: 'win'
|
||||
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
testImplementation group: 'junit', name: 'junit', version: '4.12'
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
Loading…
x
Reference in New Issue
Block a user