build.gradle 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /* Licensed to the Apache Software Foundation (ASF) under one
  2. or more contributor license agreements. See the NOTICE file
  3. distributed with this work for additional information
  4. regarding copyright ownership. The ASF licenses this file
  5. to you under the Apache License, Version 2.0 (the
  6. "License"); you may not use this file except in compliance
  7. with the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing,
  10. software distributed under the License is distributed on an
  11. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12. KIND, either express or implied. See the License for the
  13. specific language governing permissions and limitations
  14. under the License.
  15. */
  16. ext {
  17. apply from: 'cordova.gradle'
  18. cdvCompileSdkVersion = privateHelpers.getProjectTarget()
  19. cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
  20. }
  21. buildscript {
  22. repositories {
  23. // google()
  24. // jcenter()
  25. maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
  26. maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
  27. }
  28. dependencies {
  29. // The gradle plugin and the maven plugin have to be updated after each version of Android
  30. // studio comes out
  31. classpath 'com.android.tools.build:gradle:3.3.0'
  32. classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
  33. classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
  34. }
  35. }
  36. allprojects {
  37. repositories {
  38. // google()
  39. // jcenter()
  40. maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
  41. maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
  42. }
  43. }
  44. apply plugin: 'com.android.library'
  45. apply plugin: 'com.github.dcendents.android-maven'
  46. apply plugin: 'com.jfrog.bintray'
  47. group = 'org.apache.cordova'
  48. version = '8.1.0'
  49. android {
  50. compileSdkVersion cdvCompileSdkVersion
  51. buildToolsVersion cdvBuildToolsVersion
  52. compileOptions {
  53. sourceCompatibility JavaVersion.VERSION_1_8
  54. targetCompatibility JavaVersion.VERSION_1_8
  55. }
  56. // For the Android Cordova Lib, we will hardcode the minSdkVersion and not allow changes.
  57. defaultConfig {
  58. minSdkVersion 19
  59. }
  60. sourceSets {
  61. main {
  62. manifest.srcFile 'AndroidManifest.xml'
  63. java.srcDirs = ['src']
  64. resources.srcDirs = ['src']
  65. aidl.srcDirs = ['src']
  66. renderscript.srcDirs = ['src']
  67. res.srcDirs = ['res']
  68. assets.srcDirs = ['assets']
  69. }
  70. }
  71. packagingOptions {
  72. exclude 'META-INF/LICENSE'
  73. exclude 'META-INF/LICENSE.txt'
  74. exclude 'META-INF/DEPENDENCIES'
  75. exclude 'META-INF/NOTICE'
  76. }
  77. }
  78. install {
  79. repositories.mavenInstaller {
  80. pom {
  81. project {
  82. packaging 'aar'
  83. name 'Cordova'
  84. url 'https://cordova.apache.org'
  85. licenses {
  86. license {
  87. name 'The Apache Software License, Version 2.0'
  88. url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  89. }
  90. }
  91. developers {
  92. developer {
  93. id 'stevengill'
  94. name 'Steve Gill'
  95. }
  96. }
  97. scm {
  98. connection 'scm:git:https://github.com/apache/cordova-android.git'
  99. developerConnection 'scm:git:git@github.com:apache/cordova-android.git'
  100. url 'https://github.com/apache/cordova-android'
  101. }
  102. }
  103. }
  104. }
  105. }
  106. task sourcesJar(type: Jar) {
  107. from android.sourceSets.main.java.srcDirs
  108. classifier = 'sources'
  109. }
  110. artifacts {
  111. archives sourcesJar
  112. }
  113. bintray {
  114. user = System.getenv('BINTRAY_USER')
  115. key = System.getenv('BINTRAY_KEY')
  116. configurations = ['archives']
  117. pkg {
  118. repo = 'maven'
  119. name = 'cordova-android'
  120. userOrg = 'cordova'
  121. licenses = ['Apache-2.0']
  122. vcsUrl = 'https://github.com/apache/cordova-android'
  123. websiteUrl = 'https://cordova.apache.org'
  124. issueTrackerUrl = 'https://github.com/apache/cordova-android/issues'
  125. publicDownloadNumbers = true
  126. licenses = ['Apache-2.0']
  127. labels = ['android', 'cordova', 'phonegap']
  128. version {
  129. name = '8.1.0'
  130. released = new Date()
  131. vcsTag = '8.1.0'
  132. }
  133. }
  134. }