-
-
Notifications
You must be signed in to change notification settings - Fork 199
Upgraded gradle build config to use KTS and misc improvements #642
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
Open
kalmanbencze
wants to merge
19
commits into
SceneView:main
Choose a base branch
from
kalmanbencze:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
762ee38
Upgraded filament to latest version 1.66.0 and regenerated all resour…
kalmanbencze f3790b7
upgraded the rest of the libraries
kalmanbencze 217e5a7
gradle build setup upgraded to kts
kalmanbencze a2432ed
Fix Texture GEN_MIPMAPPABLE
ThomasGorisse 73a8622
Merge pull request #1 from kalmanbencze/gradle-build-system-upgrade
kalmanbencze b290bea
Merge remote-tracking branch 'upstream/main'
kalmanbencze 771a125
upgraded plugin + regenerated files using the rewritten plugin - to test
kalmanbencze 117caa2
upgraded jvm version in workflows
kalmanbencze 6ab7b3c
added back "filamentPluginEnabled" property check
kalmanbencze c31e041
cleanup
kalmanbencze f02f041
enabled project accessors and removed problematic line in settings.gr…
kalmanbencze 60ec6fc
included lib sceneview
kalmanbencze 1bae20a
addressed comments about the plugin binary param
kalmanbencze 1d7226f
added dokka config
kalmanbencze d86d800
cleanup
kalmanbencze bb49782
removed unnecessary dep declarations, modernized dependency references
kalmanbencze 737c32c
added warning for when tools dir is not set
kalmanbencze a53ac97
updated Java version for source and target
kalmanbencze 2053d71
added back missing dependency
kalmanbencze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,6 @@ | |
| .cxx | ||
| local.properties | ||
| /.idea | ||
| /build-logic/build | ||
| /build-logic/configuration/build | ||
| /build-logic/gradle | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| import org.gradle.kotlin.dsl.the | ||
|
|
||
| plugins { | ||
| id("com.android.library") | ||
| alias(libs.plugins.kotlin.android) | ||
| alias(libs.plugins.compose.compiler) | ||
| alias(libs.plugins.publish) | ||
| alias(libs.plugins.dokka) | ||
| id("filament-tools-plugin") | ||
| } | ||
|
|
||
| // ************************************************************************************************* | ||
| // Filament Plugin | ||
| // ************************************************************************************************* | ||
| // | ||
| // Needed if you want to generate Materials, Indirect Light (IBL) and Skyboxes. | ||
| // | ||
| // 1) Copy/paste the /buildSrc dir into your project root folder | ||
| // 2) Copy/paste the plugins line above (plugins: { id 'filament-tools-plugin' }) and bellow into | ||
| // your app/module build.gradle | ||
| // 3) Download the Filament tools release archive for your development desktop: | ||
| // Filament release download: https://github.com/google/filament/releases | ||
| // (Choose the corresponding version to the filament_version bellow) | ||
| // 4) Copy/paste the Filament Plugin part from the gradle.properties file to your project | ||
| // 5) Sync Gradle and clean your project | ||
| //if (project.properties["filamentPluginEnabled"]?.toString()?.toBoolean() == true) { | ||
| // configure<io.github.sceneview.FilamentToolsPluginExtension> { | ||
| // // Material generation: .mat -> .filamat | ||
| // materialInputDir.set(project.layout.projectDirectory.dir("src/main/materials")) | ||
| // materialOutputDir.set(project.layout.projectDirectory.dir("src/main/assets/materials")) | ||
| // // IBL and Skybox generation: .hdr -> _ibl.ktx and _skybox.ktx | ||
| // iblInputDir.set(project.layout.projectDirectory.dir("src/main/environments")) | ||
| // iblOutputDir.set(project.layout.projectDirectory.dir("src/main/assets/environments")) | ||
| // iblFormat = "ktx" | ||
| // } | ||
| // | ||
| // tasks.named("clean") { | ||
| // doFirst { | ||
| // delete("src/main/assets/materials") | ||
| // delete("src/main/assets/environments") | ||
| // } | ||
| // } | ||
| //} | ||
kalmanbencze marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // ************************************************************************************************* | ||
|
|
||
| android { | ||
| namespace = "io.github.sceneview.ar" | ||
| compileSdk = 36 | ||
|
|
||
| defaultConfig { | ||
| minSdk = 24 | ||
|
|
||
| consumerProguardFiles("consumer-rules.pro") | ||
| } | ||
|
|
||
| buildTypes { | ||
| getByName("release") { | ||
| isMinifyEnabled = false | ||
| proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
| } | ||
| getByName("debug") { | ||
| isMinifyEnabled = false | ||
| proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
| } | ||
| } | ||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| } | ||
| kotlinOptions { | ||
| jvmTarget = "17" | ||
| } | ||
| buildFeatures { | ||
| compose = true | ||
| } | ||
| // Preserve compression of filament files | ||
| androidResources { | ||
| noCompress.add("filamat") | ||
| noCompress.add("ktx") | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(libs.androidx.core.ktx) | ||
| implementation(libs.androidx.appcompat) | ||
|
|
||
| // Compose | ||
| implementation(libs.androidx.compose.ui) | ||
| implementation(libs.androidx.compose.foundation) | ||
|
|
||
| // SceneView | ||
| api(project(":sceneview")) | ||
|
|
||
| // ARCore | ||
| api(libs.arcore) | ||
| } | ||
|
|
||
| mavenPublishing { | ||
| publishToMavenCentral() | ||
| signAllPublications() | ||
| } | ||
|
|
||
| if (project.properties["filamentPluginEnabled"]?.toString()?.toBoolean() == true) { | ||
| configure<io.github.sceneview.FilamentToolsPluginExtension> { | ||
| // Material generation: .mat -> .filamat | ||
| materialInputDir.set(project.layout.projectDirectory.dir("src/main/materials")) | ||
| materialOutputDir.set(project.layout.projectDirectory.dir("src/main/assets/materials")) | ||
kalmanbencze marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| tasks.named("clean") { | ||
| doFirst { | ||
| delete("src/main/assets/materials") | ||
| delete("src/main/assets/environments") | ||
| } | ||
| } | ||
| } | ||
Binary file modified
BIN
-7.28 KB
(70%)
arsceneview/src/main/assets/materials/camera_stream_depth.filamat
Binary file not shown.
Binary file modified
BIN
-7.27 KB
(69%)
arsceneview/src/main/assets/materials/camera_stream_flat.filamat
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-6.94 KB
(71%)
arsceneview/src/main/assets/materials/face_mesh_occluder.filamat
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-10 KB
(85%)
arsceneview/src/main/assets/materials/plane_renderer_shadow.filamat
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
| import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
|
||
| plugins { | ||
| `kotlin-dsl` | ||
| } | ||
|
|
||
| group = "io.github.sceneview.buildlogic.configuration" | ||
|
|
||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_21 | ||
| targetCompatibility = JavaVersion.VERSION_21 | ||
| } | ||
|
|
||
| tasks.withType<KotlinCompile>().configureEach { | ||
| compilerOptions { | ||
| jvmTarget.set(JvmTarget.JVM_21) | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| compileOnly(libs.android.gradlePlugin) | ||
| compileOnly(libs.kotlin.gradlePlugin) | ||
| compileOnly(libs.publish) | ||
| } | ||
|
|
||
| gradlePlugin { | ||
| plugins { | ||
| register("filament-tools-plugin") { | ||
| id = "filament-tools-plugin" | ||
| implementationClass = "io.github.sceneview.FilamentToolsPlugin" | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the plugin code is now located in
build-logic, the manual for adding it to your own project should be updated.By the way, do you think it's possible to release the plugin as a part of Sceneview? So it can be included as a dependency instead of copying the code.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I think so, I'll set it up, and if works, I'll update the readme with how to add and run the plugin