|
| 1 | +apply plugin: 'idea' |
| 2 | +apply plugin: 'eclipse' |
| 3 | + |
| 4 | +group = 'com.docusign' |
| 5 | +version = '4.1.0' |
| 6 | + |
| 7 | +buildscript { |
| 8 | + repositories { |
| 9 | + jcenter() |
| 10 | + } |
| 11 | + dependencies { |
| 12 | + classpath 'com.android.tools.build:gradle:2.3.+' |
| 13 | + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' |
| 14 | + classpath 'ch.raffael.pegdown-doclet:pegdown-doclet:1.3' |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +repositories { |
| 19 | + jcenter() |
| 20 | +} |
| 21 | + |
| 22 | +apply plugin: 'ch.raffael.pegdown-doclet' |
| 23 | + |
| 24 | +if(hasProperty('target') && target == 'android') { |
| 25 | + |
| 26 | + apply plugin: 'com.android.library' |
| 27 | + apply plugin: 'com.github.dcendents.android-maven' |
| 28 | + |
| 29 | + android { |
| 30 | + compileSdkVersion 25 |
| 31 | + buildToolsVersion '25.0.2' |
| 32 | + defaultConfig { |
| 33 | + minSdkVersion 14 |
| 34 | + targetSdkVersion 25 |
| 35 | + } |
| 36 | + compileOptions { |
| 37 | + sourceCompatibility JavaVersion.VERSION_1_8 |
| 38 | + targetCompatibility JavaVersion.VERSION_1_8 |
| 39 | + } |
| 40 | + |
| 41 | + // Rename the aar correctly |
| 42 | + libraryVariants.all { variant -> |
| 43 | + variant.outputs.each { output -> |
| 44 | + def outputFile = output.outputFile |
| 45 | + if (outputFile != null && outputFile.name.endsWith('.aar')) { |
| 46 | + def fileName = "${project.name}-${variant.baseName}-${version}.aar" |
| 47 | + output.outputFile = new File(outputFile.parent, fileName) |
| 48 | + } |
| 49 | + } |
| 50 | + } |
| 51 | + |
| 52 | + dependencies { |
| 53 | + provided 'javax.annotation:jsr250-api:1.0' |
| 54 | + } |
| 55 | + } |
| 56 | + |
| 57 | + afterEvaluate { |
| 58 | + android.libraryVariants.all { variant -> |
| 59 | + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar |
| 60 | + task.description = "Create jar artifact for ${variant.name}" |
| 61 | + task.dependsOn variant.javaCompile |
| 62 | + task.from variant.javaCompile.destinationDir |
| 63 | + task.destinationDir = project.file("${project.buildDir}/outputs/jar") |
| 64 | + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" |
| 65 | + artifacts.add('archives', task); |
| 66 | + } |
| 67 | + } |
| 68 | + |
| 69 | + task sourcesJar(type: Jar) { |
| 70 | + from android.sourceSets.main.java.srcDirs |
| 71 | + classifier = 'sources' |
| 72 | + } |
| 73 | + |
| 74 | + artifacts { |
| 75 | + archives sourcesJar |
| 76 | + } |
| 77 | + |
| 78 | +} else { |
| 79 | + |
| 80 | + apply plugin: 'java' |
| 81 | + apply plugin: 'maven' |
| 82 | + |
| 83 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 84 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 85 | + |
| 86 | + install { |
| 87 | + repositories.mavenInstaller { |
| 88 | + pom.artifactId = 'docusign-esign-java' |
| 89 | + } |
| 90 | + } |
| 91 | + |
| 92 | + task execute(type:JavaExec) { |
| 93 | + main = System.getProperty('mainClass') |
| 94 | + classpath = sourceSets.main.runtimeClasspath |
| 95 | + } |
| 96 | + |
| 97 | + task sourcesJar(type: Jar, dependsOn: classes) { |
| 98 | + classifier = 'sources' |
| 99 | + from sourceSets.main.allSource |
| 100 | + } |
| 101 | + |
| 102 | + task javadocJar(type: Jar, dependsOn: javadoc) { |
| 103 | + classifier = 'javadoc' |
| 104 | + from javadoc.destinationDir |
| 105 | + } |
| 106 | + |
| 107 | + artifacts { |
| 108 | + archives sourcesJar |
| 109 | + archives javadocJar |
| 110 | + } |
| 111 | +} |
| 112 | + |
| 113 | +task getDeps(type: Copy) { |
| 114 | + from sourceSets.main.runtimeClasspath |
| 115 | + into 'target/lib' |
| 116 | +} |
| 117 | + |
| 118 | +ext { |
| 119 | + swagger_annotations_version = "1.5.17" |
| 120 | + jackson_version = "2.10.1" |
| 121 | + jersey_version = "2.29.1" |
| 122 | + junit_version = "4.12" |
| 123 | + oltu_version = "1.0.2" |
| 124 | + jwt_version = "3.4.1" |
| 125 | + bouncy_version = "1.60" |
| 126 | +} |
| 127 | + |
| 128 | +dependencies { |
| 129 | + compile "io.swagger:swagger-annotations:$swagger_annotations_version" |
| 130 | + compile "org.glassfish.jersey.core:jersey-client:$jersey_version" |
| 131 | + compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" |
| 132 | + compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" |
| 133 | + compile group: "org.glassfish.jersey.inject", name: "jersey-hk2", version: "2.26" |
| 134 | + compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" |
| 135 | + compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" |
| 136 | + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" |
| 137 | + compile "org.glassfish.jersey.inject:jersey-hk2:$jersey_version" |
| 138 | + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" |
| 139 | + testCompile "junit:junit:$junit_version" |
| 140 | + compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" |
| 141 | + compile "com.auth0:java-jwt:$jwt_version" |
| 142 | + compile "org.bouncycastle:bcprov-jdk15on:$bouncy_version" |
| 143 | +} |
| 144 | + |
0 commit comments