Advertisement
Guest User

Untitled

a guest
Aug 30th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. apply plugin: 'com.android.model.application'
  2.  
  3. Properties properties = new Properties()
  4. properties.load(project.rootProject.file('local.properties').newDataInputStream())
  5. def superpowered_sdk_path = properties.getProperty('superpowered.dir')
  6.  
  7. model {
  8. repositories {
  9. libs(PrebuiltLibraries) {
  10. superpowered { // this is where you declare the "superpowered" static library
  11. headers.srcDir "${superpowered_sdk_path}"
  12. binaries.withType(StaticLibraryBinary) { // attaching library files to each platform
  13. def platformName = targetPlatform.getName()
  14. if (platformName == "armeabi-v7a") {
  15. staticLibraryFile = file("${superpowered_sdk_path}/libSuperpoweredAndroidARM.a")
  16. } else if (platformName == "arm64-v8a") {
  17. staticLibraryFile = file("${superpowered_sdk_path}/libSuperpoweredAndroidARM64.a")
  18. } else if (platformName == "x86") {
  19. staticLibraryFile = file("${superpowered_sdk_path}/libSuperpoweredAndroidX86.a")
  20. } else if (platformName == "x86_64") {
  21. staticLibraryFile = file("${superpowered_sdk_path}/libSuperpoweredAndroidX86_64.a")
  22. }
  23. }
  24. }
  25. }
  26. }
  27.  
  28. android { // main settings for your application
  29. compileSdkVersion = 23
  30. buildToolsVersion = "23.0.2"
  31.  
  32. defaultConfig {
  33. applicationId "com.superpowered.crossexample"
  34. minSdkVersion.apiLevel = 16 // more than 95% of all active Android devices
  35. targetSdkVersion.apiLevel = 23
  36. versionCode 1
  37. versionName "1.0"
  38. }
  39. }
  40.  
  41. android.ndk { // your application's native layer parameters
  42. moduleName = "SuperpoweredExample"
  43. platformVersion = 16
  44. stl = "c++_static"
  45. CFlags.addAll(["-O3", "-fsigned-char"]) // full optimization, char data type is signed
  46. cppFlags.addAll(["-fsigned-char", "-I${superpowered_sdk_path}".toString()])
  47. ldLibs.addAll(["log", "android", "OpenSLES", 'EGL', 'GLESv2','atomic']) // load these libraries: log, android, OpenSL ES (for audio)
  48. abiFilters.addAll(["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]) // these platforms cover 99% percent of all Android devices
  49. }
  50.  
  51. android.sources.main.jni {
  52. source {
  53. srcDir "src/main/jni"
  54. srcDir "${superpowered_sdk_path}/AndroidIO"
  55. }
  56. dependencies {
  57. library "superpowered" linkage "static" // this is where you attach the "superpowered" static library to your app
  58. }
  59. }
  60. }
  61.  
  62. dependencies {
  63. compile fileTree(dir: 'libs', include: ['*.jar'])
  64. compile 'com.android.support:appcompat-v7:23.4.0'
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement