Skip to content

Commit 2482d56

Browse files
Update settings.gradle
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 0e87c59 commit 2482d56

1 file changed

Lines changed: 73 additions & 65 deletions

File tree

settings.gradle

Lines changed: 73 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,67 @@
11
/**
22
* This is the global settings file used by all subprojects.
33
**/
4-
pluginManagement {
5-
includeBuild 'jme3-nativeimage-plugin'
6-
repositories {
7-
gradlePluginPortal()
8-
mavenCentral()
9-
google()
10-
}
11-
}
12-
4+
pluginManagement {
5+
includeBuild 'jme3-nativeimage-plugin'
6+
repositories {
7+
gradlePluginPortal()
8+
mavenCentral()
9+
google()
10+
}
11+
}
12+
1313
plugins {
1414
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
1515
}
1616

17-
rootProject.name = 'jmonkeyengine'
18-
19-
def androidExamplesMinCompileSdk = 34
20-
21-
def findAndroidSdk = {
22-
def sdkDirs = []
23-
24-
if (gradle.startParameter.projectProperties['android.sdk.path']) {
25-
sdkDirs << file(gradle.startParameter.projectProperties['android.sdk.path'])
26-
}
27-
28-
def localProperties = file('local.properties')
29-
if (localProperties.isFile()) {
30-
Properties properties = new Properties()
31-
localProperties.withInputStream { properties.load(it) }
32-
if (properties.getProperty('sdk.dir')) {
33-
sdkDirs << file(properties.getProperty('sdk.dir'))
34-
}
35-
}
36-
37-
if (System.env.ANDROID_HOME) {
38-
sdkDirs << file(System.env.ANDROID_HOME)
39-
}
40-
if (System.env.ANDROID_SDK_ROOT) {
41-
sdkDirs << file(System.env.ANDROID_SDK_ROOT)
42-
}
43-
sdkDirs << file("${System.properties['user.home']}/Android/Sdk")
44-
45-
return sdkDirs.unique { it.absolutePath }.collect { sdkDir ->
46-
def platformDir = new File(sdkDir, 'platforms')
47-
def compileSdk = platformDir.listFiles()?.collect { platform ->
48-
def matcher = platform.name =~ /^android-(\d+)$/
49-
matcher.matches() && new File(platform, 'android.jar').isFile() ? matcher[0][1] as int : null
50-
}?.findAll { it != null }?.max()
51-
52-
[dir: sdkDir, compileSdk: compileSdk]
53-
}.find { sdk ->
54-
sdk.dir.isDirectory() && sdk.compileSdk != null && sdk.compileSdk >= androidExamplesMinCompileSdk
55-
}
56-
}
17+
rootProject.name = 'jmonkeyengine'
18+
19+
def androidExamplesMinCompileSdk = 34
20+
21+
def findAndroidSdk = {
22+
def sdkDirs = []
23+
24+
if (gradle.startParameter.projectProperties['android.sdk.path']) {
25+
sdkDirs << file(gradle.startParameter.projectProperties['android.sdk.path'])
26+
}
27+
28+
def localProperties = file('local.properties')
29+
if (localProperties.isFile()) {
30+
Properties properties = new Properties()
31+
localProperties.withInputStream { properties.load(it) }
32+
if (properties.getProperty('sdk.dir')) {
33+
sdkDirs << file(properties.getProperty('sdk.dir'))
34+
}
35+
}
36+
37+
if (System.env.ANDROID_HOME) {
38+
sdkDirs << file(System.env.ANDROID_HOME)
39+
}
40+
if (System.env.ANDROID_SDK_ROOT) {
41+
sdkDirs << file(System.env.ANDROID_SDK_ROOT)
42+
}
43+
if (System.env.ANDROID_HOME) {
44+
sdkDirs << file(System.env.ANDROID_HOME)
45+
}
46+
if (System.env.ANDROID_SDK_ROOT) {
47+
sdkDirs << file(System.env.ANDROID_SDK_ROOT)
48+
}
49+
sdkDirs << file("${System.properties['user.home']}/Android/Sdk")
50+
sdkDirs << file("${System.properties['user.home']}/Library/Android/sdk")
51+
sdkDirs << file("${System.properties['user.home']}/AppData/Local/Android/Sdk")
52+
53+
return sdkDirs.unique { it.absolutePath }.collect { sdkDir ->
54+
def platformDir = new File(sdkDir, 'platforms')
55+
def compileSdk = platformDir.listFiles()?.collect { platform ->
56+
def matcher = platform.name =~ /^android-(\d+)$/
57+
matcher.matches() && new File(platform, 'android.jar').isFile() ? matcher[0][1] as int : null
58+
}?.findAll { it != null }?.max()
59+
60+
[dir: sdkDir, compileSdk: compileSdk]
61+
}.find { sdk ->
62+
sdk.dir.isDirectory() && sdk.compileSdk != null && sdk.compileSdk >= androidExamplesMinCompileSdk
63+
}
64+
}
5765

5866
// Core classes, should work on all java platforms
5967
include 'jme3-core'
@@ -77,22 +85,22 @@ if (JavaVersion.current().isJava8Compatible()) {
7785
include 'jme3-jbullet'
7886
include 'jme3-niftygui'
7987
include 'jme3-jogg'
80-
include 'jme3-android'
81-
include 'jme3-ios'
82-
83-
// Test Data project
84-
include 'jme3-testdata'
88+
include 'jme3-android'
89+
include 'jme3-ios'
90+
91+
// Test Data project
92+
include 'jme3-testdata'
8593

8694
// Example projects
87-
include 'jme3-examples'
88-
include 'jme3-awt-dialogs'
89-
90-
def androidSdk = findAndroidSdk()
91-
if (androidSdk != null) {
92-
System.setProperty('android.home', androidSdk.dir.absolutePath)
93-
gradle.ext.androidExamplesCompileSdk = androidSdk.compileSdk
94-
include 'jme3-android-examples'
95-
}
96-
include 'jme3-ios-examples'
97-
include 'jme3-screenshot-tests'
95+
include 'jme3-examples'
96+
include 'jme3-awt-dialogs'
97+
98+
def androidSdk = findAndroidSdk()
99+
if (androidSdk != null) {
100+
System.setProperty('android.home', androidSdk.dir.absolutePath)
101+
gradle.ext.androidExamplesCompileSdk = androidSdk.compileSdk
102+
include 'jme3-android-examples'
103+
}
104+
include 'jme3-ios-examples'
105+
include 'jme3-screenshot-tests'
98106

0 commit comments

Comments
 (0)