Skip to content
Snippets Groups Projects
Commit 07ff81f4 authored by kr328's avatar kr328
Browse files

Fix: should add main golang source as input

parent c0e1e45b
No related branches found
No related tags found
No related merge requests found
import com.github.kr328.golang.GolangBuildTask
import com.github.kr328.golang.GolangPlugin
import java.io.FileOutputStream
import java.net.URL
......@@ -14,6 +15,7 @@ val geoipDatabaseUrl =
"https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb"
val geoipInvalidate = Duration.ofDays(7)!!
val geoipOutput = buildDir.resolve("intermediates/golang_blob")
val golangSource = file("src/main/golang/native")
golang {
sourceSets {
......@@ -37,7 +39,7 @@ android {
all {
externalNativeBuild {
cmake {
arguments("-DGO_SOURCE:STRING=${file("src/main/golang/native")}")
arguments("-DGO_SOURCE:STRING=${golangSource}")
arguments("-DGO_OUTPUT:STRING=${GolangPlugin.outputDirOf(project, null, null)}")
arguments("-DFLAVOR_NAME:STRING=$name")
}
......@@ -65,6 +67,12 @@ repositories {
mavenCentral()
}
afterEvaluate {
tasks.withType(GolangBuildTask::class.java).forEach {
it.inputs.file(golangSource)
}
}
task("downloadGeoipDatabase") {
val databaseFile = geoipOutput.resolve("Country.mmdb")
val moduleFile = geoipOutput.resolve("go.mod")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment