|
1 |
| - group = 'io.swagger' |
2 |
| - project.version = '1.0.0' |
| 1 | +group = 'io.swagger' |
| 2 | +project.version = '1.0.0' |
3 | 3 |
|
4 | 4 | buildscript {
|
5 |
| -repositories { |
6 |
| -jcenter() |
7 |
| -} |
8 |
| -dependencies { |
9 |
| -classpath 'com.android.tools.build:gradle:1.2.2' |
10 |
| - classpath 'com.github.dcendents:android-maven-plugin:1.2' |
11 |
| -} |
| 5 | + repositories { |
| 6 | + jcenter() |
| 7 | + } |
| 8 | + dependencies { |
| 9 | + classpath 'com.android.tools.build:gradle:1.2.2' |
| 10 | + |
| 11 | + classpath 'com.github.dcendents:android-maven-plugin:1.2' |
| 12 | + |
| 13 | + } |
12 | 14 | }
|
13 | 15 |
|
14 | 16 | allprojects {
|
15 |
| -repositories { |
16 |
| -jcenter() |
17 |
| -} |
| 17 | + repositories { |
| 18 | + jcenter() |
| 19 | + } |
18 | 20 | }
|
19 | 21 |
|
20 | 22 |
|
21 | 23 | apply plugin: 'com.android.library'
|
22 |
| - apply plugin: 'com.github.dcendents.android-maven' |
| 24 | +apply plugin: 'com.github.dcendents.android-maven' |
23 | 25 |
|
24 | 26 | android {
|
25 |
| -compileSdkVersion 22 |
26 |
| -buildToolsVersion '22.0.0' |
27 |
| -defaultConfig { |
28 |
| -minSdkVersion 14 |
29 |
| -targetSdkVersion 22 |
30 |
| -} |
| 27 | + compileSdkVersion 22 |
| 28 | + buildToolsVersion '22.0.0' |
| 29 | + defaultConfig { |
| 30 | + minSdkVersion 14 |
| 31 | + targetSdkVersion 22 |
| 32 | + } |
31 | 33 |
|
32 |
| -// Rename the aar correctly |
33 |
| -libraryVariants.all { variant -> |
34 |
| -variant.outputs.each { output -> |
35 |
| -def outputFile = output.outputFile |
36 |
| -if (outputFile != null && outputFile.name.endsWith('.aar')) { |
37 |
| -def fileName = "${project.name}-${variant.baseName}-${version}.aar" |
38 |
| -output.outputFile = new File(outputFile.parent, fileName) |
39 |
| -} |
40 |
| -} |
41 |
| -} |
| 34 | + // Rename the aar correctly |
| 35 | + libraryVariants.all { variant -> |
| 36 | + variant.outputs.each { output -> |
| 37 | + def outputFile = output.outputFile |
| 38 | + if (outputFile != null && outputFile.name.endsWith('.aar')) { |
| 39 | + def fileName = "${project.name}-${variant.baseName}-${version}.aar" |
| 40 | + output.outputFile = new File(outputFile.parent, fileName) |
| 41 | + } |
| 42 | + } |
| 43 | + } |
42 | 44 | }
|
43 | 45 |
|
44 | 46 |
|
45 | 47 | ext {
|
46 |
| -swagger_annotations_version = "1.5.0" |
47 |
| -gson_version = "2.3.1" |
48 |
| -httpclient_version = "4.3.3" |
49 |
| -junit_version = "4.8.1" |
| 48 | + swagger_annotations_version = "1.5.0" |
| 49 | + gson_version = "2.3.1" |
| 50 | + httpclient_version = "4.3.3" |
| 51 | + junit_version = "4.8.1" |
50 | 52 | }
|
51 | 53 |
|
52 | 54 | dependencies {
|
53 |
| -compile "io.swagger:swagger-annotations:$swagger_annotations_version" |
54 |
| -compile "com.google.code.gson:gson:$gson_version" |
55 |
| -compile "org.apache.httpcomponents:httpcore:$httpclient_version" |
56 |
| -compile "org.apache.httpcomponents:httpclient:$httpclient_version" |
57 |
| -compile ("org.apache.httpcomponents:httpcore:$httpclient_version") { |
58 |
| -exclude(group: 'org.apache.httpcomponents', module: 'httpclient') |
59 |
| -} |
60 |
| -compile ("org.apache.httpcomponents:httpmime:$httpclient_version") { |
61 |
| -exclude(group: 'org.apache.httpcomponents', module: 'httpclient') |
62 |
| -} |
63 |
| -testCompile "junit:junit:$junit_version" |
| 55 | + compile "io.swagger:swagger-annotations:$swagger_annotations_version" |
| 56 | + compile "com.google.code.gson:gson:$gson_version" |
| 57 | + compile "org.apache.httpcomponents:httpcore:$httpclient_version" |
| 58 | + compile "org.apache.httpcomponents:httpclient:$httpclient_version" |
| 59 | + compile ("org.apache.httpcomponents:httpcore:$httpclient_version") { |
| 60 | + exclude(group: 'org.apache.httpcomponents', module: 'httpclient') |
| 61 | + } |
| 62 | + compile ("org.apache.httpcomponents:httpmime:$httpclient_version") { |
| 63 | + exclude(group: 'org.apache.httpcomponents', module: 'httpclient') |
| 64 | + } |
| 65 | + testCompile "junit:junit:$junit_version" |
64 | 66 | }
|
65 | 67 |
|
66 | 68 | afterEvaluate {
|
67 |
| -android.libraryVariants.all { variant -> |
68 |
| -def task = project.tasks.create "jar${variant.name.capitalize()}", Jar |
69 |
| -task.description = "Create jar artifact for ${variant.name}" |
70 |
| -task.dependsOn variant.javaCompile |
71 |
| -task.from variant.javaCompile.destinationDir |
72 |
| -task.destinationDir = project.file("${project.buildDir}/outputs/jar") |
73 |
| -task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" |
74 |
| -artifacts.add('archives', task); |
75 |
| -} |
| 69 | + android.libraryVariants.all { variant -> |
| 70 | + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar |
| 71 | + task.description = "Create jar artifact for ${variant.name}" |
| 72 | + task.dependsOn variant.javaCompile |
| 73 | + task.from variant.javaCompile.destinationDir |
| 74 | + task.destinationDir = project.file("${project.buildDir}/outputs/jar") |
| 75 | + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" |
| 76 | + artifacts.add('archives', task); |
| 77 | + } |
76 | 78 | }
|
77 | 79 |
|
78 |
| - task sourcesJar(type: Jar) { |
| 80 | +task sourcesJar(type: Jar) { |
79 | 81 | from android.sourceSets.main.java.srcDirs
|
80 | 82 | classifier = 'sources'
|
81 |
| - } |
| 83 | +} |
82 | 84 |
|
83 |
| - artifacts { |
| 85 | +artifacts { |
84 | 86 | archives sourcesJar
|
85 |
| - } |
| 87 | +} |
0 commit comments