Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'processResources' task instead of 'jar' task for nativeruntime #6874

Merged
merged 1 commit into from Nov 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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