/
build.gradle
106 lines (92 loc) · 3.14 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
plugins {
id 'com.android.library'
id 'maven-publish'
id 'signing'
}
group = 'com.viliussutkus89'
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionCode 4
versionName rootProject.version
archivesBaseName = rootProject.name
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
configurations {
javadocDependenciesToObtainClasspath
}
dependencies {
implementation 'androidx.annotation:annotation:1.2.0'
javadocDependenciesToObtainClasspath 'androidx.annotation:annotation:1.2.0'
}
task sourceJar(type: Jar) {
archiveClassifier.set('sources')
into ("", { from android.sourceSets.main.java.srcDirs} )
into ("", { from file("../LICENSE")})
}
task javadoc(type: Javadoc) {
options.encoding = 'UTF-8'
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.javadocDependenciesToObtainClasspath
title = "${rootProject.name} ${project.version} API"
failOnError = false
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
artifactId rootProject.name
version = rootProject.version
artifact sourceJar
artifact javadocJar
pom {
name = rootProject.name
description = 'Run standalone (console) executables on Android'
url = 'https://github.com/ViliusSutkus89/ExecutableRunner-Android'
packaging = 'aar'
inceptionYear = '2020'
licenses {
license {
name = 'The GNU General Public License, Version 3'
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id = "ViliusSutkus89"
name = "Vilius Sutkus"
email = "ViliusSutkus89@gmail.com"
}
}
scm {
url = 'https://github.com/ViliusSutkus89/ExecutableRunner-Android'
connection = 'https://github.com/ViliusSutkus89/ExecutableRunner-Android.git'
}
}
}
}
}
// This may look ugly...
// but useInMemoryPgpKeys expects valid keys even with required { false }
if (System.getenv('SIGNING_KEY')) {
signing {
required { true }
useInMemoryPgpKeys(System.getenv('SIGNING_KEY'), System.getenv('SIGNING_PASS'))
sign publishing.publications.release
}
}
}