forked from facebookarchive/rebound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
139 lines (118 loc) · 3.86 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
apply plugin: 'com.android.library'
import com.android.builder.core.BuilderConstants
android {
compileSdkVersion Integer.parseInt(project.ANDROID_COMPILE_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion 11
targetSdkVersion Integer.parseInt(project.ANDROID_TARGET_SDK_VERSION)
}
sourceSets {
main {
manifest.srcFile 'rebound-android/src/main/AndroidManifest.xml'
java.srcDirs = ['rebound-core/src/main/java', 'rebound-android/src/main/java']
}
}
}
// Create jar for distribution.
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals(BuilderConstants.RELEASE)) {
// Distribution Jar Task
def distJarTask = task reboundDistJar(type: Jar, dependsOn: variant.javaCompile) {
from variant.javaCompile.destinationDir
}
artifacts.add('archives', distJarTask)
// Javadocs Task
def javadocsTask = task androidJavadocs(type: Javadoc, dependsOn: variant.javaCompile) {
source = variant.javaCompile.source
def androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompile.classpath.files, androidJar)
options {
links "http://docs.oracle.com/javase/7/docs/api/"
linksOffline "http://d.android.com/reference","${android.sdkDirectory}/docs/reference"
}
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
def javadocsJarTask = task androidJavadocsJar(type: Jar, dependsOn: javadocsTask) {
classifier = 'javadoc'
from javadocsTask.destinationDir
}
artifacts.add('archives', javadocsJarTask)
// Sources Jar Task
def sourcesJarTask = task androidSourcesJar(type: Jar) {
classifier = 'sources'
from variant.javaCompile.source
}
artifacts.add('archives', sourcesJarTask)
}
}
task installExample(dependsOn: 'rebound-android-example:installDebug')
task installPlayground(dependsOn: 'rebound-android-playground:installDebug')
task smokeTest(dependsOn: [
'rebound-core:assemble',
'rebound-core:check',
'rebound-android:assemble',
'rebound-android:check',
'rebound-android-example:assembleDebug',
'rebound-android-playground:assembleDebug',
'reboundDistJar'
])
// Configure gradle.properties to do maven builds
if (!project.hasProperty('sonatypeRepo') ||
!project.hasProperty('sonatypeUsername') ||
!project.hasProperty('sonatypePassword')) {
return;
}
// Maven Push
apply plugin: 'maven'
apply plugin: 'signing'
version = "0.3.8"
group = "com.facebook.rebound"
signing {
required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: sonatypeRepo) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name 'Rebound'
packaging 'jar'
description 'Rebound is a simple spring dynamics animation library for Java and Android applications.'
url 'http://facebook.github.io/rebound'
scm {
url 'scm:git@github.com:facebook/rebound.git'
connection 'scm:git@github.com:facebook/rebound.git'
developerConnection 'scm:git@github.com:facebook/rebound.git'
}
licenses {
license {
name 'BSD 2-Clause License'
url 'https://github.com/facebook/rebound/blob/master/LICENSE'
distribution 'repo'
}
}
developers {
developer {
id 'will.bailey'
name 'Will Bailey'
email 'will.bailey@gmail.com'
}
}
}
}
}