@@ -32,6 +32,7 @@ allprojects {
32
32
// Exclude generated bindings
33
33
exclude(" **/wp_api.kt" )
34
34
exclude(" **/wp_localization.kt" )
35
+ exclude(" **/wp_mobile.kt" )
35
36
}
36
37
37
38
tasks.withType< io.gitlab.arturbosch.detekt.DetektCreateBaselineTask > ().configureEach {
@@ -40,6 +41,7 @@ allprojects {
40
41
// Exclude generated bindings
41
42
exclude(" **/wp_api.kt" )
42
43
exclude(" **/wp_localization.kt" )
44
+ exclude(" **/wp_mobile.kt" )
43
45
}
44
46
45
47
dependencies {
@@ -52,28 +54,28 @@ val rustcBinaryPath = resolveBinary("rustc")
52
54
val cargoProjectRoot = " ${project.rootDir} /../.."
53
55
val jniLibsPath = " ${layout.buildDirectory.get()} /jniLibs/"
54
56
val generatedTestResourcesPath = " ${layout.buildDirectory.get()} /generatedTestResources/"
55
- val rustModuleName = " wp_api "
57
+ val rustPrimaryModule = " wp_mobile "
56
58
val nativeLibraryPath =
57
- " $cargoProjectRoot /target/release/lib${rustModuleName }${getNativeLibraryExtension()} "
59
+ " $cargoProjectRoot /target/release/lib${rustPrimaryModule }${getNativeLibraryExtension()} "
58
60
59
61
rootProject.ext.set(" cargoBinaryPath" , cargoBinaryPath)
60
62
rootProject.ext.set(" rustcBinaryPath" , rustcBinaryPath)
61
63
rootProject.ext.set(" cargoProjectRoot" , cargoProjectRoot)
62
64
rootProject.ext.set(" jniLibsPath" , jniLibsPath)
63
65
rootProject.ext.set(" generatedTestResourcesPath" , generatedTestResourcesPath)
64
66
rootProject.ext.set(" nativeLibraryPath" , nativeLibraryPath)
65
- rootProject.ext.set(" rustModuleName " , rustModuleName )
67
+ rootProject.ext.set(" rustPrimaryModule " , rustPrimaryModule )
66
68
67
69
setupJniAndBindings()
68
70
69
71
// Separated as a function to have everything in a scope and keep it contained
70
72
fun setupJniAndBindings () {
71
73
val nativeLibraryPath =
72
- " $cargoProjectRoot /target/release/lib${rustModuleName }${getNativeLibraryExtension()} "
74
+ " $cargoProjectRoot /target/release/lib${rustPrimaryModule }${getNativeLibraryExtension()} "
73
75
74
76
val cargoBuildLibraryReleaseTask = tasks.register<Exec >(" cargoBuildLibraryRelease" ) {
75
77
workingDir(rootProject.ext.get(" cargoProjectRoot" )!! )
76
- commandLine(cargoBinaryPath, " build" , " --package" , rustModuleName , " --release" )
78
+ commandLine(cargoBinaryPath, " build" , " --package" , rustPrimaryModule , " --release" )
77
79
// No inputs.dir added, because we want to always re-run this task and let Cargo handle caching
78
80
}
79
81
0 commit comments