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

Avoid re-running ICU ./configure if Makefile exists #6889

Merged
merged 2 commits into from Nov 29, 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
43 changes: 26 additions & 17 deletions nativeruntime/build.gradle
Expand Up @@ -41,16 +41,20 @@ task configureICU {
if (!file("$projectDir/external/icu/icu4c/source").exists()) {
throw new GradleException("ICU submodule not detected. Please run `git submodule update --init`")
}
exec {
workingDir "$projectDir/external/icu/icu4c/source"
if (os.contains("linux")) {
environment "CFLAGS", "-fPIC"
environment "CXXFLAGS", "-fPIC"
commandLine './runConfigureICU', 'Linux', '--enable-static', '--disable-shared'
} else if (os.contains("mac")) {
commandLine './runConfigureICU', 'MacOSX', '--enable-static', '--disable-shared'
} else {
println("Skipping the nativeruntime build for OS '${System.getProperty("os.name")}'")
if (file("$projectDir/external/icu/icu4c/source/Makefile").exists()) {
println("ICU Makefile detected, skipping ICU configure")
} else {
exec {
workingDir "$projectDir/external/icu/icu4c/source"
if (os.contains("linux")) {
environment "CFLAGS", "-fPIC"
environment "CXXFLAGS", "-fPIC"
commandLine './runConfigureICU', 'Linux', '--enable-static', '--disable-shared'
} else if (os.contains("mac")) {
commandLine './runConfigureICU', 'MacOSX', '--enable-static', '--disable-shared'
} else {
println("ICU configure not supported for OS '${System.getProperty("os.name")}'")
}
utzcoz marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down Expand Up @@ -83,14 +87,19 @@ task makeNativeRuntime {

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")
if (System.getenv('SKIP_NATIVERUNTIME_BUILD')) {
println("Skipping the nativeruntime build");
} else if (!os.contains("linux") && !os.contains("mac")) {
println("Building the nativeruntime not supported for OS '${System.getProperty("os.name")}'")
} else {
dependsOn makeNativeRuntime
from ("$buildDir/cpp") {
include '*libnativeruntime.*'
rename { String fileName ->
fileName.replace("libnativeruntime", "librobolectric-nativeruntime")
}
into "native/${os}/${arch()}/"
}
into "native/${os}/${arch()}/"
}
}

Expand Down