Skip to content

Commit

Permalink
Refactor the project structure (#202)
Browse files Browse the repository at this point in the history
- Consolidate all the vendors modules into a single `plugin` module with multiple vendors product flavors to allow for vendor-specific customizations
- Add `GodotOpenXR.kt` to consolidate common java/kotlin logic for the OpenXR vendors plugin implementations
- Move native code from the `common` directory to the `plugin/src/main/cpp` directory
  • Loading branch information
m4gr3d authored Sep 13, 2024
1 parent b38201a commit b854a74
Show file tree
Hide file tree
Showing 125 changed files with 480 additions and 994 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ local.properties

# Misc
.DS_Store
/common/src/gen/
/plugin/src/gen/
12 changes: 6 additions & 6 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ opts.Update(env)

# Add common includes
env.Append(CPPPATH=[
"#common/src/main/cpp/include/",
"#plugin/src/main/cpp/include/",
"#thirdparty/openxr/include/",
])

sources = []
sources += Glob("#common/src/main/cpp/*.cpp")
sources += Glob("#common/src/main/cpp/export/*.cpp")
sources += Glob("#common/src/main/cpp/extensions/*.cpp")
sources += Glob("#common/src/main/cpp/classes/*.cpp")
sources += Glob("#plugin/src/main/cpp/*.cpp")
sources += Glob("#plugin/src/main/cpp/export/*.cpp")
sources += Glob("#plugin/src/main/cpp/extensions/*.cpp")
sources += Glob("#plugin/src/main/cpp/classes/*.cpp")

if env["target"] in ["editor", "template_debug"]:
doc_data = env.GodotCPPDocData("#common/src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml"))
doc_data = env.GodotCPPDocData("#plugin/src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml"))
sources.append(doc_data)

binary_path = '#demo/addons/godotopenxrvendors/.bin'
Expand Down
16 changes: 3 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ task clean(type: Delete) {
dependsOn 'cleanAddon'
dependsOn 'cleanBuildFromSamples'

dependsOn ':godotopenxrkhronos:clean'
dependsOn ':godotopenxrlynx:clean'
dependsOn ':godotopenxrmeta:clean'
dependsOn ':godotopenxrpico:clean'
dependsOn ':godotopenxrmagicleap:clean'
dependsOn ':plugin:clean'
}

/**
Expand All @@ -52,13 +48,7 @@ task cleanAddon(type: Delete) {
task buildPlugin {
// Generate the editor gdextension binaries
dependsOn ':buildSconsArtifacts'

dependsOn ":godotopenxrkhronos:build"
dependsOn ":godotopenxrlynx:build"
dependsOn ":godotopenxrmeta:build"
dependsOn ":godotopenxrpico:build"
dependsOn ":godotopenxrmagicleap:build"

dependsOn ":plugin:build"
finalizedBy "copyBuildToSamples"
}

Expand Down Expand Up @@ -158,4 +148,4 @@ task cleanBuildFromSamples {
}
}
}
}
}
24 changes: 12 additions & 12 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ ext {
libraries = [
godotAndroidLib: "org.godotengine:godot:4.3.0.stable",
]
}

// Parse the release version from the gradle project properties (e.g: -Prelease_version=<version>)
ext.getReleaseVersion = { ->
final String defaultVersion = "3.1.0-dev-SNAPSHOT"
// Parse the release version from the gradle project properties (e.g: -Prelease_version=<version>)
getReleaseVersion = { ->
final String defaultVersion = "3.1.0-dev-SNAPSHOT"

String releaseVersion = project.hasProperty("release_version") ? project.property("release_version") : defaultVersion
if (releaseVersion == null || releaseVersion.isEmpty()) {
releaseVersion = defaultVersion
}
String releaseVersion = project.hasProperty("release_version") ? project.property("release_version") : defaultVersion
if (releaseVersion == null || releaseVersion.isEmpty()) {
releaseVersion = defaultVersion
}

if (!releaseVersion.endsWithIgnoreCase("-stable") && !releaseVersion.endsWithIgnoreCase("-snapshot")) {
releaseVersion += "-SNAPSHOT"
}
if (!releaseVersion.endsWithIgnoreCase("-stable") && !releaseVersion.endsWithIgnoreCase("-snapshot")) {
releaseVersion += "-SNAPSHOT"
}

return releaseVersion
return releaseVersion
}
}
42 changes: 0 additions & 42 deletions godotopenxrkhronos/CMakeLists.txt

This file was deleted.

106 changes: 0 additions & 106 deletions godotopenxrkhronos/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion godotopenxrlynx/.gitignore

This file was deleted.

47 changes: 0 additions & 47 deletions godotopenxrlynx/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit b854a74

Please sign in to comment.