Update iOS integration guide #29
This commit is contained in:
parent
1ac57cb719
commit
4994d611fe
29
docs/ios.md
29
docs/ios.md
@ -1,18 +1,33 @@
|
||||
### iOS implementation
|
||||
|
||||
RoboVm needs the native libs / frameworks to create a build.
|
||||
Copy those files from `vtm-ios-[CURRENT-VERSION]-natives.jar` into a temp folder.
|
||||
|
||||
Create a copy task into your **build.gradle**.
|
||||
Create a copy task into your iOS **build.gradle** and add the dependencies.
|
||||
|
||||
```groovy
|
||||
task copyFrameWorks(type: Copy) {
|
||||
from(zipTree("./libs/vtm-ios-[CURRENT-VERSION]-natives.jar"))
|
||||
into("${buildDir}/native")
|
||||
configurations { natives }
|
||||
|
||||
dependencies {
|
||||
compile "org.mapsforge:vtm-ios:[CURRENT-VERSION]"
|
||||
natives "org.mapsforge:vtm-ios:[CURRENT-VERSION]:natives"
|
||||
...
|
||||
}
|
||||
|
||||
tasks.withType(org.gradle.api.tasks.compile.JavaCompile) {
|
||||
compileTask -> compileTask.dependsOn copyFrameWorks
|
||||
// Called every time Gradle gets executed. Takes the native dependencies of
|
||||
// the 'natives' configuration and extracts them to the proper build folders
|
||||
// so they get packed with the IPA.
|
||||
task copyNatives() {
|
||||
file("build/native/").mkdirs();
|
||||
configurations.natives.files.each { jar ->
|
||||
def outputDir = null
|
||||
if (jar.name.endsWith("natives.jar")) outputDir = file("build/native/")
|
||||
if (outputDir != null) {
|
||||
copy {
|
||||
from zipTree(jar)
|
||||
into outputDir
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user