Skip to content

Commit

Permalink
Merge pull request #6874 from hoisie/use-process-resources
Browse files Browse the repository at this point in the history
Use 'processResources' task instead of 'jar' task for nativeruntime
  • Loading branch information
hoisie committed Nov 21, 2021
2 parents a42eb54 + a606cdc commit 7502aa1
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions nativeruntime/build.gradle
Expand Up @@ -81,28 +81,17 @@ task makeNativeRuntime {
}
}

task copyNativeRuntime {
dependsOn makeNativeRuntime
doLast {
copy {
from ("$buildDir/cpp") {
include '*libnativeruntime.*'
}
rename { String fileName ->
fileName.replace("libnativeruntime", "librobolectric-nativeruntime")
}
into project.file("$buildDir/resources/main/native/${osName()}/${arch()}/")
}
}
}

jar {
def os = osName()
if (!System.getenv('SKIP_NATIVERUNTIME_BUILD') && (os.contains("linux") || os.contains("mac"))) {
dependsOn copyNativeRuntime
} else {
println("Skipping the nativeruntime build for OS '${System.getProperty("os.name")}'")
}
processResources {
def os = osName()
onlyIf { !System.getenv('SKIP_NATIVERUNTIME_BUILD') && (os.contains("linux") || os.contains("mac")) }
dependsOn makeNativeRuntime
from ("$buildDir/cpp") {
include '*libnativeruntime.*'
rename { String fileName ->
fileName.replace("libnativeruntime", "librobolectric-nativeruntime")
}
into "native/${os}/${arch()}/"
}
}

dependencies {
Expand Down

0 comments on commit 7502aa1

Please sign in to comment.