|
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 |
| - |
11 |
| - classpath 'com.github.dcendents:android-maven-plugin:1.2' |
12 |
| - |
13 |
| - } |
| 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 | +} |
14 | 12 | }
|
15 | 13 |
|
16 | 14 | allprojects {
|
17 |
| - repositories { |
18 |
| - jcenter() |
19 |
| - } |
| 15 | +repositories { |
| 16 | +jcenter() |
| 17 | +} |
20 | 18 | }
|
21 | 19 |
|
22 | 20 |
|
23 | 21 | apply plugin: 'com.android.library'
|
24 |
| -apply plugin: 'com.github.dcendents.android-maven' |
| 22 | + apply plugin: 'com.github.dcendents.android-maven' |
25 | 23 |
|
26 | 24 | android {
|
27 |
| - compileSdkVersion 22 |
28 |
| - buildToolsVersion '22.0.0' |
29 |
| - defaultConfig { |
30 |
| - minSdkVersion 14 |
31 |
| - targetSdkVersion 22 |
32 |
| - } |
| 25 | +compileSdkVersion 22 |
| 26 | +buildToolsVersion '22.0.0' |
| 27 | +defaultConfig { |
| 28 | +minSdkVersion 14 |
| 29 | +targetSdkVersion 22 |
| 30 | +} |
33 | 31 |
|
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 |
| - } |
| 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 | +} |
44 | 42 | }
|
45 | 43 |
|
46 | 44 |
|
47 | 45 | ext {
|
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" |
| 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" |
52 | 50 | }
|
53 | 51 |
|
54 | 52 | dependencies {
|
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" |
| 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" |
66 | 64 | }
|
67 | 65 |
|
68 | 66 | afterEvaluate {
|
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 |
| - } |
| 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 | +} |
78 | 76 | }
|
79 | 77 |
|
80 |
| -task sourcesJar(type: Jar) { |
| 78 | + task sourcesJar(type: Jar) { |
81 | 79 | from android.sourceSets.main.java.srcDirs
|
82 | 80 | classifier = 'sources'
|
83 |
| -} |
| 81 | + } |
84 | 82 |
|
85 |
| -artifacts { |
| 83 | + artifacts { |
86 | 84 | archives sourcesJar
|
87 |
| -} |
| 85 | + } |
0 commit comments