Android Studio 打jar包

清疚 2023-10-05 12:27 108阅读 0赞
  1. task androidSourcesJar(type: Jar) {
  2. classifier = 'sources'
  3. from android.sourceSets.main.java.sourceFiles
  4. }
  5. artifacts {
  6. archives androidSourcesJar
  7. }

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3hpYW9lcmJ1eXUxMjMz_size_16_color_FFFFFF_t_70

完整

  1. apply plugin: 'com.android.library'
  2. android {
  3. compileSdkVersion 25
  4. buildToolsVersion "26.0.0"
  5. defaultConfig {
  6. minSdkVersion 15
  7. targetSdkVersion 25
  8. versionCode 1
  9. versionName "1.0"
  10. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  11. }
  12. buildTypes {
  13. release {
  14. minifyEnabled false
  15. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  16. }
  17. }
  18. }
  19. task androidSourcesJar(type: Jar) {
  20. classifier = 'sources'
  21. from android.sourceSets.main.java.sourceFiles
  22. }
  23. artifacts {
  24. archives androidSourcesJar
  25. }
  26. dependencies {
  27. compile fileTree(dir: 'libs', include: ['*.jar'])
  28. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  29. exclude group: 'com.android.support', module: 'support-annotations'
  30. })
  31. compile 'com.android.support:appcompat-v7:25.4.0'
  32. testCompile 'junit:junit:4.12'
  33. }

发表评论

表情:
评论列表 (有 0 条评论,108人围观)

还没有评论,来说两句吧...

相关阅读

    相关 android studio 引入class jar

    我们开发过程中,不可避免的会用到他人的代码,这其中有引用jar包和引用第三方工程项目。而对于一些公司的一些特定项目,可能会涉及到class.jar的修改。下面简单记录下工程中涉