forked from facebookarchive/rebound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
132 lines (108 loc) · 3.43 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.1+'
}
}
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 19
}
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 ->
if (name.equals(com.android.builder.BuilderConstants.RELEASE)) {
def task = project.tasks.create "reboundDistJar", Jar
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
artifacts.add('archives', task)
}
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.allJava
}
task androidJavadocsJar(type: Jar) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.allSource
}
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
task installOrigamiExample(dependsOn: 'rebound-android-origami-example:installDebug')
task installExample(dependsOn: 'rebound-android-example:installDebug')
task smokeTest(dependsOn: [
'rebound-core:assemble',
'rebound-core:check',
'rebound-android:assemble',
'rebound-android:check',
'rebound-android-example:assembleDebug',
'rebound-android-origami-example: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.3"
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:[email protected]:facebook/rebound.git'
connection 'scm:[email protected]:facebook/rebound.git'
developerConnection 'scm:[email protected]: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 '[email protected]'
}
}
}
}
}