This repository was archived by the owner on Aug 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.gradle
More file actions
80 lines (65 loc) · 1.97 KB
/
build.gradle
File metadata and controls
80 lines (65 loc) · 1.97 KB
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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.0"
}
}
subprojects {
if (project.name == "aarWrapper") return // Setup lint checks with the same setup
apply plugin: 'java'
group = 'io.vokal.lint'
configurations {
lintChecks
}
dependencies {
lintChecks files(jar)
}
defaultTasks 'assemble'
task install(type: Copy) {
from configurations.lintChecks
into System.getProperty('user.home') + '/.android/lint/'
}
task copyLintJar(type: Copy) {
from(configurations.lintChecks) {
rename {
String fileName ->
'lint.jar'
}
}
into '../aarWrapper/build/intermediates/lint/'
}
task copyWrappedAAR(type: Copy) {
from("../aarWrapper/build/outputs/aar/aarWrapper-release.aar") {
rename {
String fileName ->
"${project.name}-$version-release.aar"
}
}
into 'build/libs/'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task aarWrapper << { }
project.afterEvaluate {
def aarProj = parent.project("aarWrapper")
aarProj.android.libraryVariants.forEach {
it.mergedFlavor.setApplicationId(it.applicationId + ".${project.name.toLowerCase()}")
}
def aarWrap = aarProj.tasks.find { it.name == 'assemble' }
aarWrapper.dependsOn(copyLintJar)
aarWrapper.dependsOn(aarWrap)
aarWrapper.dependsOn(copyWrappedAAR)
aarWrap.mustRunAfter(copyLintJar)
copyWrappedAAR.mustRunAfter(aarWrap)
artifactoryPublish.dependsOn(aarWrapper)
}
}