This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 125
/
build.gradle
140 lines (124 loc) · 4.68 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
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
buildscript {
ext.kotlin_version = '1.3.61'
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'maven-publish'
group = "com.github.instagram"
version = 0.8
subprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
task processorJar(type: Jar,
dependsOn: ["javawriter:build", "common:build", "util:build", "processor:build"]) {
from files({ project(':javawriter').sourceSets.main.output.classesDir })
from files({ project(':common').sourceSets.main.output.classesDir })
from files({ project(':util').sourceSets.main.output.classesDir })
from files({ project(':processor').sourceSets.main.output.classesDir })
from files({ project(':processor').sourceSets.main.output.resourcesDir })
baseName 'processor'
}
task runtimeJar(type: Jar,
dependsOn: "common:build") {
from files({ project(':common').sourceSets.main.output.classesDir })
baseName 'runtime'
}
task runtimeSourcesJar(type: Jar) {
classifier = 'sources'
baseName 'runtime'
from files({ project(':common').sourceSets.main.allJava })
}
task processorSourcesJar(type: Jar) {
classifier = 'sources'
baseName 'processor'
from files({ project(':javawriter').sourceSets.main.allJava })
from files({ project(':common').sourceSets.main.allJava })
from files({ project(':util').sourceSets.main.allJava })
from files({ project(':processor').sourceSets.main.allJava })
}
task runtimeJavadoc(type: Javadoc) {
source files({ project(':common').sourceSets.main.allJava })
destinationDir = new File("${project.docsDir}", "runtime-javadoc")
}
task runtimeJavadocJar(type: Jar, dependsOn: runtimeJavadoc) {
classifier = 'javadoc'
baseName 'runtime'
from runtimeJavadoc.destinationDir
}
task processorJavadoc(type: Javadoc) {
source files({ project(':javawriter').sourceSets.main.allJava })
source files({ project(':common').sourceSets.main.allJava })
source files({ project(':util').sourceSets.main.allJava })
source files({ project(':processor').sourceSets.main.allJava })
destinationDir = new File("${project.docsDir}", "processor-javadoc")
classpath += files({ project(':common').sourceSets.main.compileClasspath })
classpath += files({ project(':processor').sourceSets.main.compileClasspath })
classpath += files({ project(':util').sourceSets.main.compileClasspath })
}
task processorJavadocJar(type: Jar, dependsOn: processorJavadoc) {
classifier = 'javadoc'
baseName 'processor'
from processorJavadoc.destinationDir
}
artifacts {
archives processorJar
archives runtimeJar
archives runtimeSourcesJar
archives processorSourcesJar
archives runtimeJavadocJar
archives processorJavadocJar
}
install {
repositories.mavenInstaller {
addFilter('processor') { artifact, file -> artifact.name.contains('processor') }
pom("processor").withXml {
def dependenciesNode = asNode().appendNode('dependencies')
project(":processor").configurations.compile.allDependencies.findAll {
it.group != project(":processor").group // filter out local modules
} .each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
addFilter('runtime') { artifact, file -> artifact.name.contains('runtime') }
pom("runtime").withXml {
def dependenciesNode = asNode().appendNode('dependencies')
project(":common").configurations.compile.allDependencies.findAll {
it.group != project(":common").group // filter out local modules
} .each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}