Skip to content

Commit

Permalink
* Update instructions to integrate BuildTask with Android Studio (…
Browse files Browse the repository at this point in the history
…issue #22)
  • Loading branch information
saudet committed Nov 1, 2022
1 parent f80b2f3 commit dc71a38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

* Remove lambda expressions since Gradle dislikes them ([issue #23](https://github.com/bytedeco/gradle-javacpp/issues/23))
* Update instructions to integrate `BuildTask` with Android Studio ([issue #22](https://github.com/bytedeco/gradle-javacpp/issues/22))

### February 11, 2022 version 1.5.7
* Update README.md with sample `javacppExtract` task for Android App Bundles (AABs)
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ It is also possible to integrate the `BuildTask` with Android Studio for project
android.applicationVariants.all { variant ->
def variantName = variant.name.capitalize() // either "Debug" or "Release"
def javaCompile = project.tasks.getByName("compile${variantName}JavaWithJavac")
def generateJson = project.tasks.getByName("generateJsonModel$variantName")
def configureCMake = project.tasks.findAll {
it.name.startsWith("configureCMake$variantName")
}
// Compiles NativeLibraryConfig.java
task "javacppCompileJava$variantName"(type: JavaCompile) {
Expand Down Expand Up @@ -118,7 +120,9 @@ android.applicationVariants.all { variant ->
}
// Picks up the C++ files listed in CMakeLists.txt
generateJson.dependsOn "javacppBuildCompiler$variantName"
configureCMake.forEach {
it.dependsOn "javacppBuildCompiler$variantName"
}
}
```
3. Updating the `CMakeLists.txt` file to include the generated `.cpp` files.
Expand Down

0 comments on commit dc71a38

Please sign in to comment.