mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-28 13:36:05 +00:00
Fix gradle script build error
This commit is contained in:
1 parent
6b3531964e
commit
94f6044c9a
2 files changed
+7
-4
No files matched your search
@@ -18,6 +18,7 @@ import com.qcloud.cos.ClientConfig
|
||||
import com.qcloud.cos.auth.BasicCOSCredentials
|
||||
import com.qcloud.cos.auth.COSCredentials
|
||||
import com.qcloud.cos.model.PutObjectRequest
|
||||
import com.qcloud.cos.model.GetObjectRequest
|
||||
import com.qcloud.cos.region.Region
|
||||
|
||||
String getMcVersion(String filename) {
|
||||
@@ -70,7 +71,7 @@ void downloadFile(String key, File file) {
|
||||
getCosClient().getObject(getObjectRequest, file)
|
||||
}
|
||||
|
||||
void uploadArtifacts() {
|
||||
void uploadArtifacts(String shortVersion) {
|
||||
File dir = rootProject.file("build/libs")
|
||||
if (!dir.isDirectory()) return
|
||||
File[] files = dir.listFiles()
|
||||
@@ -78,8 +79,9 @@ void uploadArtifacts() {
|
||||
String key = getKey(file.getName())
|
||||
uploadFile(key, file)
|
||||
String url = cosUrl + key
|
||||
String version = getMcVersion(file.getName())
|
||||
println(version + "\t" + url)
|
||||
String mcversion = getMcVersion(file.getName()).replace(".", "").toLowerCase()
|
||||
String version = shortVersion.replace(".", "")
|
||||
println(String.format("csl-%s-%s\t%s", mcversion, version, url))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -26,10 +26,11 @@ subprojects {
|
||||
}
|
||||
|
||||
apply from: rootProject.file('BuildScripts/cos.gradle')
|
||||
apply from: rootProject.file('BuildScripts/version.gradle')
|
||||
|
||||
task upload {
|
||||
onlyIf { System.getenv("COS_SECRET_KEY") != null }
|
||||
doLast {
|
||||
uploadArtifacts()
|
||||
uploadArtifacts(getShortVersion())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user