-
-
Notifications
You must be signed in to change notification settings - Fork 316
/
build.gradle
146 lines (125 loc) · 5.59 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
138
139
140
141
142
143
144
145
146
buildscript {
ext.kotlin_version = '1.4.10'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.28.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
if (project.hasProperty('LOCAL_MAVEN_URL')) {
maven { url LOCAL_MAVEN_URL }
}
google()
jcenter()
// maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
version = VERSION_NAME
group = GROUP
// do we actually need javadoc any more?
tasks.withType(Javadoc) {
enabled = false
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
wrapper {
gradleVersion '6.1.1'
distributionType 'all'
}
if (hasProperty('local')) {
if (!hasProperty('LOCAL_MAVEN_URL')) {
throw new RuntimeException('Cannot publish to local maven as no such property exists: LOCAL_MAVEN_URL')
}
ext.RELEASE_REPOSITORY_URL = LOCAL_MAVEN_URL
ext.SNAPSHOT_REPOSITORY_URL = LOCAL_MAVEN_URL
}
ext {
config = [
'build-tools' : '29.0.3',
'compile-sdk' : 29,
'target-sdk' : 29,
'min-sdk' : 16,
'push-aar-gradle': 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle'
]
final def commonMarkVersion = '0.13.0'
final def daggerVersion = '2.10'
final def coilVersion = '0.13.0'
// please note that `pl.droidsonroids.gif:android-gif-drawable:1.2.15` is used due to the minimum
// api level mismatch that Markwon supports (16) and later versions of AndroidGifDrawable (17).
// It should not be a problem as this dependency is used as `compileOnly` and users
// must specify version explicitly (until library's API changes...)
deps = [
'x-annotations' : 'androidx.annotation:annotation:1.1.0',
'x-recycler-view' : 'androidx.recyclerview:recyclerview:1.0.0',
'x-core' : 'androidx.core:core:1.0.2',
'x-appcompat' : 'androidx.appcompat:appcompat:1.1.0',
'x-cardview' : 'androidx.cardview:cardview:1.0.0',
'x-fragment' : 'androidx.fragment:fragment:1.0.0',
'commonmark' : "com.atlassian.commonmark:commonmark:$commonMarkVersion",
'commonmark-strikethrough': "com.atlassian.commonmark:commonmark-ext-gfm-strikethrough:$commonMarkVersion",
'commonmark-table' : "com.atlassian.commonmark:commonmark-ext-gfm-tables:$commonMarkVersion",
'android-svg' : 'com.caverock:androidsvg:1.4',
// we need 2 gif artifacts at long as we have a difference in version used for API compatibility
'android-gif' : 'pl.droidsonroids.gif:android-gif-drawable:1.2.15',
'android-gif-impl' : 'pl.droidsonroids.gif:android-gif-drawable:1.2.20',
'jlatexmath-android' : 'ru.noties:jlatexmath-android:0.2.0',
'okhttp' : 'com.squareup.okhttp3:okhttp:3.9.0',
'prism4j' : 'io.noties:prism4j:2.0.0',
'debug' : 'io.noties:debug:5.1.0',
'adapt' : 'io.noties:adapt:2.2.0',
'dagger' : "com.google.dagger:dagger:$daggerVersion",
'picasso' : 'com.squareup.picasso:picasso:2.71828',
'glide' : 'com.github.bumptech.glide:glide:4.11.0',
'coil' : "io.coil-kt:coil:$coilVersion",
'coil-base' : "io.coil-kt:coil-base:$coilVersion",
'ix-java' : 'com.github.akarnokd:ixjava:1.0.0',
'gson' : 'com.google.code.gson:gson:2.8.6',
'commons-io' : 'commons-io:commons-io:2.6'
]
deps['annotationProcessor'] = [
'prism4j-bundler': 'io.noties:prism4j-bundler:2.0.0',
'dagger-compiler': "com.google.dagger:dagger-compiler:$daggerVersion"
]
deps['test'] = [
'junit' : 'junit:junit:4.12',
'robolectric' : 'org.robolectric:robolectric:3.8',
'mockito' : 'org.mockito:mockito-core:2.21.0',
'commonmark-test-util': "com.atlassian.commonmark:commonmark-test-util:$commonMarkVersion",
]
registerArtifact = this.®isterArtifact
}
task checkUpdates {
apply plugin: 'com.github.ben-manes.versions'
dependsOn 'dependencyUpdates'
}
def registerArtifact(project) {
if (hasProperty('release')) {
// to be used in github actions (to publish a snapshot)
// but only if we have snapshot in the version name
if (hasProperty('CI') && VERSION_NAME.contains('SNAPSHOT')) {
ext.NEXUS_USERNAME = System.getenv('NEXUS_USERNAME')
ext.NEXUS_PASSWORD = System.getenv('NEXUS_PASSWORD')
}
project.apply from: config['push-aar-gradle']
}
project.afterEvaluate {
// disable generation of BuildConfig files
project.generateDebugBuildConfig.enabled = false
project.generateReleaseBuildConfig.enabled = false
// print test status (for CI)
project.android.testOptions.unitTests.all {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "short"
showStandardStreams = true
}
}
}
}