mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2024-11-23 05:46:09 +03:00
Fix: should add main golang source as input
This commit is contained in:
parent
c0e1e45b72
commit
07ff81f4db
@ -1,3 +1,4 @@
|
|||||||
|
import com.github.kr328.golang.GolangBuildTask
|
||||||
import com.github.kr328.golang.GolangPlugin
|
import com.github.kr328.golang.GolangPlugin
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
@ -14,6 +15,7 @@ val geoipDatabaseUrl =
|
|||||||
"https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb"
|
"https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb"
|
||||||
val geoipInvalidate = Duration.ofDays(7)!!
|
val geoipInvalidate = Duration.ofDays(7)!!
|
||||||
val geoipOutput = buildDir.resolve("intermediates/golang_blob")
|
val geoipOutput = buildDir.resolve("intermediates/golang_blob")
|
||||||
|
val golangSource = file("src/main/golang/native")
|
||||||
|
|
||||||
golang {
|
golang {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@ -37,7 +39,7 @@ android {
|
|||||||
all {
|
all {
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
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("-DGO_OUTPUT:STRING=${GolangPlugin.outputDirOf(project, null, null)}")
|
||||||
arguments("-DFLAVOR_NAME:STRING=$name")
|
arguments("-DFLAVOR_NAME:STRING=$name")
|
||||||
}
|
}
|
||||||
@ -65,6 +67,12 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
tasks.withType(GolangBuildTask::class.java).forEach {
|
||||||
|
it.inputs.file(golangSource)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
task("downloadGeoipDatabase") {
|
task("downloadGeoipDatabase") {
|
||||||
val databaseFile = geoipOutput.resolve("Country.mmdb")
|
val databaseFile = geoipOutput.resolve("Country.mmdb")
|
||||||
val moduleFile = geoipOutput.resolve("go.mod")
|
val moduleFile = geoipOutput.resolve("go.mod")
|
||||||
|
Loading…
Reference in New Issue
Block a user