gradle docker config tidy up

This commit is contained in:
Adam 2022-06-20 23:59:57 +02:00
parent e56ecb7d36
commit e0f689c538
7 changed files with 31 additions and 44 deletions

View file

@ -12,9 +12,9 @@ dependencyResolutionManagement {
repositories { repositories {
myMavenLocal() myMavenLocal()
mavenCentral() mavenCentral()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") { // maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
mavenContent { snapshotsOnly() } // mavenContent { snapshotsOnly() }
} // }
jitpack() jitpack()
gradlePluginPortal() gradlePluginPortal()

View file

@ -1,3 +1,5 @@
rootProject.name = "buildSrc"
apply(from = "./repositories.settings.gradle.kts") apply(from = "./repositories.settings.gradle.kts")
@Suppress("UnstableApiUsage") // Central declaration of repositories is an incubating feature @Suppress("UnstableApiUsage") // Central declaration of repositories is an incubating feature

View file

@ -8,6 +8,7 @@ plugins {
idea idea
} }
group = rootProject.group group = rootProject.group
version = rootProject.version version = rootProject.version
@ -18,19 +19,6 @@ tasks.withType<WriteProperties>().configureEach {
} }
val hardReset by tasks.registering(Delete::class) {
group = rootProject.name
doFirst("hardResetConfirmation") {
val answer = project.serviceOf<UserInputHandler>()
.askYesNoQuestion("Are you sure you want to permanently delete Kafkatorio data?")
if (answer != true) {
throw GradleException("Aborting hard reset")
}
}
}
tasks.withType<AbstractArchiveTask>().configureEach { tasks.withType<AbstractArchiveTask>().configureEach {
exclude("**/.secret.*") exclude("**/.secret.*")
} }

View file

@ -23,6 +23,7 @@ val dockerUp by tasks.registering(Exec::class) {
commandLine = parseSpaceSeparatedArgs(""" docker-compose up -d """) commandLine = parseSpaceSeparatedArgs(""" docker-compose up -d """)
} }
val dockerDown by tasks.registering(Exec::class) { val dockerDown by tasks.registering(Exec::class) {
group = dockerComposeTaskGroup group = dockerComposeTaskGroup
@ -42,11 +43,13 @@ val dockerRemove by tasks.registering(Exec::class) {
commandLine = parseSpaceSeparatedArgs(""" docker-compose rm --stop -v -f """) commandLine = parseSpaceSeparatedArgs(""" docker-compose rm --stop -v -f """)
} }
afterEvaluate { afterEvaluate {
tasks.named("processRun") { dependsOn(dockerUp, dockerEnv) } tasks.named("processRun") { dependsOn(dockerUp, dockerEnv) }
tasks.named("processKill") { dependsOn(dockerDown) } tasks.named("processKill") { dependsOn(dockerDown) }
} }
val dockerEnv by tasks.registering(WriteProperties::class) { val dockerEnv by tasks.registering(WriteProperties::class) {
group = dockerComposeTaskGroup group = dockerComposeTaskGroup
@ -60,4 +63,5 @@ val dockerEnv by tasks.registering(WriteProperties::class) {
) )
} }
tasks.assemble { dependsOn(dockerEnv) } tasks.assemble { dependsOn(dockerEnv) }

View file

@ -9,8 +9,7 @@
"engines": { "engines": {
"node": "~14.19.1" "node": "~14.19.1"
}, },
"devDependencies": { "devDependencies": {},
},
"dependencies": { "dependencies": {
"lua-types": "^2.11.0", "lua-types": "^2.11.0",
"typescript-to-lua": "1.6.0", "typescript-to-lua": "1.6.0",
@ -18,10 +17,7 @@
"typescript": "4.7.4" "typescript": "4.7.4"
}, },
"license": "UNLICENSED", "license": "UNLICENSED",
"peerDependencies": { "peerDependencies": {},
}, "optionalDependencies": {},
"optionalDependencies": { "bundledDependencies": []
},
"bundledDependencies": [
]
} }

View file

@ -57,17 +57,3 @@ idea {
excludeDirs.add(file("src/factorio-server")) excludeDirs.add(file("src/factorio-server"))
} }
} }
tasks.hardReset {
dependsOn(tasks.dockerRemove)
delete(
factorioServerDataDir.dir("saves"),
factorioServerDataDir.dir("temp"),
factorioServerDataDir.file("factorio-current.log"),
factorioServerDataDir.file("factorio-previous.log"),
factorioServerDataDir.file(".lock"),
)
}

View file

@ -18,16 +18,27 @@ typealias TileOnLoadFn = (done: DoneCallback, tile: HTMLElement) -> Unit
sealed interface PolylinePathPoints { sealed interface PolylinePathPoints {
value class D1(val points: Array<LatLng>) : PolylinePathPoints value class D1(val points: List<LatLng>) : PolylinePathPoints {
value class D2(val points: Array<Array<LatLng>>) : PolylinePathPoints constructor(points: Array<LatLng>)
value class D3(val points: Array<Array<Array<LatLng>>>) : PolylinePathPoints : this(points.toList())
}
value class D2(val points: List<List<LatLng>>) : PolylinePathPoints {
constructor(points: Array<Array<LatLng>>)
: this(points.map { x -> x.toList() }.toList())
}
value class D3(val points: List<List<List<LatLng>>>) : PolylinePathPoints {
constructor(points: Array<Array<Array<LatLng>>>)
: this(points.map { x -> x.map { y -> y.toList() } }.toList())
}
} }
inline fun Polyline<*>.getLatLngs2(): PolylinePathPoints? { inline fun Polyline<*>.getLatLngs2(): PolylinePathPoints? {
return when (val points = this.getLatLngs()) { return when (val points = this.getLatLngs()) {
is Array<LatLng> -> PolylinePathPoints.D1(points as Array<LatLng>) is Array<LatLng> -> PolylinePathPoints.D1(points.unsafeCast<Array<LatLng>>())
is Array<Array<LatLng>> -> PolylinePathPoints.D2(points as Array<Array<LatLng>>) is Array<Array<LatLng>> -> PolylinePathPoints.D2(points.unsafeCast<Array<Array<LatLng>>>())
is Array<Array<Array<LatLng>>> -> PolylinePathPoints.D3(points as Array<Array<Array<LatLng>>>) is Array<Array<Array<LatLng>>> -> PolylinePathPoints.D3(points.unsafeCast<Array<Array<Array<LatLng>>>>())
else -> null else -> null
} }
} }