Skip to content

Commit

Permalink
move gradle's cmake build out of source tree
Browse files Browse the repository at this point in the history
Summary: Allow build to be done closer to the root of a filesystem to avoid Windows path length limitations. Some quest apps still fail to build (on multiple platforms) for other reasons.

Reviewed By: enpe

Differential Revision: D59544475

fbshipit-source-id: 61ce8de453216c15635ba1dd3ad4762629dfcebb
  • Loading branch information
ASchneiderMeta authored and facebook-github-bot committed Jul 10, 2024
1 parent 8c31cda commit c9aea74
Show file tree
Hide file tree
Showing 75 changed files with 704 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ android {
arguments += "-DBUILD_SHARED_LIBS=OFF"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_base_console_android_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ android {
arguments += "-DBUILD_SHARED_LIBS=OFF"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_cv_detector_linedetector_android_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ android {
arguments += "-DBUILD_SHARED_LIBS=OFF"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_cv_detector_messengercode_android_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ android {
arguments += "-DBUILD_SHARED_LIBS=OFF"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_cv_detector_qrcodes_detector2d_android_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ android {
arguments += "-DBUILD_SHARED_LIBS=OFF"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_media_externalcamera_android_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ android {
arguments += "-DOCEAN_ENABLE_QUEST=TRUE"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_media_externalcamera_quest_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ android {
arguments += "-DBUILD_SHARED_LIBS=OFF"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_media_videopreview_android_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ android {
arguments += "-DBUILD_SHARED_LIBS=OFF"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_platform_android_pixelformat_android_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ android {
arguments += "-DOCEAN_ENABLE_QUEST=TRUE"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_platform_meta_quest_openxr_fingerdistance_quest_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ android {
arguments += "-DOCEAN_ENABLE_QUEST=TRUE"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_platform_meta_quest_openxr_graphs_quest_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ android {
arguments += "-DOCEAN_ENABLE_QUEST=TRUE"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_platform_meta_quest_openxr_handgestures_quest_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ android {
arguments += "-DOCEAN_ENABLE_QUEST=TRUE"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_platform_meta_quest_openxr_microphone_quest_native"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ android {
arguments += "-DOCEAN_ENABLE_QUEST=TRUE"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets +=
"application_ocean_demo_platform_meta_quest_openxr_nativeapplication_quest_native"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if (!file(project.properties["oceanThirdPartyPath"]).exists()) {
throw GradleException(
"Path specified for parameter 'oceanThirdPartyPath' does not exist: '${project.properties["oceanThirdPartyPath"]}'")
}

if (!project.hasProperty("oceanGradleBuildPath")) {
println(
"oceanGradleBuildPath not specified, checking for environment variable OCEAN_GRADLE_BUILD_PATH...")
var defaultPath = System.getenv("OCEAN_GRADLE_BUILD_PATH")
if (defaultPath != null && !defaultPath.isEmpty()) {
println("Using OCEAN_GRADLE_BUILD_PATH environment variable: ${defaultPath}")
} else {
var osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("win")) {
defaultPath = "C:\\tmp\\ocean\\gradle"
} else {
defaultPath = "/tmp/ocean/gradle"
}
println("Environment variable not found. Using fallback path: ${defaultPath}")
}
project.ext["oceanGradleBuildPath"] = defaultPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ android {
arguments += "-DOCEAN_ENABLE_QUEST=TRUE"
arguments +=
"-DOCEAN_THIRD_PARTY_ROOT_FROM_GRADLE=${project.properties["oceanThirdPartyPath"]}"
arguments += "-B${project.properties["oceanGradleBuildPath"]}"
targets += "application_ocean_demo_platform_meta_quest_openxr_panoramaviewer_quest_native"
}
}
Expand Down
Loading

0 comments on commit c9aea74

Please sign in to comment.