-
Notifications
You must be signed in to change notification settings - Fork 36
/
build.gradle
137 lines (124 loc) · 3.85 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
plugins {
id 'com.android.library'
id 'digital.wup.android-maven-publish' version '3.6.2'
id "com.jfrog.bintray" version "1.8.4"
}
android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 8
targetSdkVersion 30
versionName libraryVersion
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFile "proguard-rules.pro"
}
buildTypes {
release {
minifyEnabled false
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
}
lintOptions {
abortOnError false
}
}
dependencies {
api 'org.mozilla:rhino-runtime:1.7.13'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.jakewharton.android.repackaged:dalvik-dx:11.0.0_r3'
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
source += files('build/generated/source/aidl/release') + files('build/generated/source/apt/release')
javadoc.classpath += files(android.getBootClasspath().join(File.pathSeparator))
options.with {
linksOffline "http://d.android.com/reference", "${android.sdkDirectory.path}/docs/reference"
links "http://mozilla.github.io/rhino/javadoc/"
}
doFirst {
try {
javadoc.classpath += files(android.libraryVariants.collect { variant -> variant.javaCompile.classpath.files }) + files('build/generated/source/r/release')
} catch (e) {
logger.warn('failed to get classpath for javadoc', e)
}
}
afterEvaluate {
dependsOn "assembleRelease"
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc
classifier = 'javadoc'
}
ext.createPom = { pom ->
pom.withXml {
def xml = {
name 'rhino-android'
description 'Allows to use rhino on android'
url 'https://github.com/F43nd1r/rhino-android'
scm {
connection 'scm:git:https://github.com/F43nd1r/rhino-android.git'
developerConnection 'scm:git:[email protected]:F43nd1r/rhino-android.git'
url 'https://github.com/F43nd1r/rhino-android.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'f43nd1r'
name 'Lukas Morawietz'
}
}
}
xml.resolveStrategy = DELEGATE_FIRST
asNode().children().last() + xml
}
}
publishing {
publications {
maven(MavenPublication) {
from components.android
groupId 'com.faendir.rhino'
version libraryVersion
artifact sourcesJar
artifact javadocJar
createPom(pom)
}
}
}
bintray {
user = artifactoryUser
key = artifactoryApiKey
publications = ['maven']
publish = true
pkg {
repo = 'maven'
name = 'rhino-android'
websiteUrl = 'https://github.com/F43nd1r/rhino-android'
vcsUrl = 'https://github.com/F43nd1r/rhino-android.git'
licenses = ['The Apache Software License, Version 2.0']
publicDownloadNumbers = true
version {
name = libraryVersion
desc = 'Allows to use rhino on android'
mavenCentralSync {
sync = true
user = ossrhUser
password = ossrhPassword
}
}
}
}
bintrayUpload.dependsOn(build, javadocJar, sourcesJar, 'generatePomFileForMavenPublication')