-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
126 lines (109 loc) · 4.01 KB
/
build.gradle.kts
File metadata and controls
126 lines (109 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
namespace = "org.the3deer.android.engine"
compileSdk = 36
version = "2.0.2"
defaultConfig {
minSdk = 24
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
buildTypes {
release {
isMinifyEnabled = false
isShrinkResources = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
packaging {
jniLibs {
useLegacyPackaging = false
}
}
sourceSets {
getByName("main") {
java.srcDirs("src/main/java")
if (project.findProperty("org.the3deer.android.engine.includeGltf") == "true") {
java.srcDir("src/gltf/java")
dependencies {
implementation(libs.fasterxml.jackson.databind)
}
}
if (project.findProperty("org.the3deer.android.engine.includeFbx") == "true") {
java.srcDir("src/fbx/java")
jniLibs.srcDir("src/fbx/cpp")
}
if (project.findProperty("org.the3deer.android.engine.includeObj") == "true") {
java.srcDir("src/obj/java")
}
if (project.findProperty("org.the3deer.android.engine.includeStl") == "true") {
java.srcDir("src/stl/java")
}
if (project.findProperty("org.the3deer.android.engine.includeDae") == "true") {
java.srcDir("src/dae/java")
}
}
}
if (project.findProperty("org.the3deer.android.engine.includeFbx") == "true") {
externalNativeBuild {
cmake {
path = file("src/fbx/cpp/CMakeLists.txt")
version = "3.22.1"
}
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
}
// Javadoc configuration
tasks.register<Javadoc>("javadoc") {
// Ensure the R class and other generated sources are compiled first
dependsOn("compileDebugJavaWithJavac")
val mainSourceSet = android.sourceSets.getByName("main")
// Set the source directories
setSource(mainSourceSet.java.srcDirs)
// Exclude the mock javax.imageio package from Javadoc generation
// This prevents the "package exists in another module: java.desktop" error
exclude("javax/imageio/**")
exclude("de/javagl/jgltf/**")
exclude("**/BuildConfig.java")
exclude("**/R.java")
exclude("org/the3deer/engine/util/mapbox/**")
exclude("org/poly2tri/**")
// Initialize classpath with Android SDK
classpath = project.files(android.bootClasspath)
options {
val options = this as StandardJavadocDocletOptions
options.links("https://developer.android.com/reference")
options.links("https://docs.oracle.com/javase/8/docs/api/")
options.addStringOption("Xdoclint:none", "-quiet")
options.encoding = "UTF-8"
options.charSet = "UTF-8"
options.docTitle = "Android 3D Engine API"
options.windowTitle = "Android 3D Engine API"
}
doFirst {
// Use the debug variant's classpath and output
val variant = android.libraryVariants.find { it.name == "debug" }
if (variant != null) {
val compileTask = variant.javaCompileProvider.get()
// Add all project dependencies
classpath += compileTask.classpath
// Add the compiled classes (including the generated R class and mock javax.imageio)
// This allows other classes that use javax.imageio to resolve symbols
classpath += project.files(compileTask.destinationDirectory)
}
}
}