Skip to content

Commit

Permalink
update bs+deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Sep 22, 2023
1 parent 349bcc0 commit 8e4107d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
32 changes: 23 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1692122114
//version: 1695323114
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -600,15 +600,10 @@ repositories {
}
maven {
name = "ic2"
url = "https://maven.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/")
content {
includeGroup "net.industrial-craft"
}
}
maven {
name = "ic2-mirror"
url = "https://maven2.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
Expand Down Expand Up @@ -1576,6 +1571,25 @@ def getSecondaryArtifacts() {
return secondaryArtifacts
}

def getURL(String main, String fallback) {
return pingURL(main, 10000) ? main : fallback
}

// credit: https://stackoverflow.com/a/3584332
def pingURL(String url, int timeout) {
url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates.
try {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection()
connection.setConnectTimeout(timeout)
connection.setReadTimeout(timeout)
connection.setRequestMethod("HEAD")
int responseCode = connection.getResponseCode()
return 200 <= responseCode && responseCode <= 399
} catch (IOException ignored) {
return false
}
}

// For easier scripting of things that require variables defined earlier in the buildscript
if (file('addon.late.gradle.kts').exists()) {
apply from: 'addon.late.gradle.kts'
Expand Down
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ dependencies {
shadowImplementation('cglib:cglib-nodep:3.3.0')

compileOnly('com.github.GTNewHorizons:waila:1.6.0:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-254-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-256-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.16:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.16-pre-experimental:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.19:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.0:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.12.0-GTNH:api') {transitive = false}
implementation('com.github.GTNewHorizons:Chisel:2.11.4-GTNH:dev') {transitive = false}
Expand Down

0 comments on commit 8e4107d

Please sign in to comment.