Skip to content

Commit da38bee

Browse files
authored
Merge pull request #2 from ParsePlatform/tasks/initial-project
(っ˘▽˘)っ ☁️☁️☁️ ⊂(◕。◕⊂)
2 parents 4d01542 + c0995a7 commit da38bee

30 files changed

+2327
-1
lines changed

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# built application files
2+
*.apk
3+
*.ap_
4+
5+
# files for the dex VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# generated files
12+
bin/
13+
gen/
14+
15+
# Local configuration file (sdk path, etc)
16+
local.properties
17+
18+
# Android Studio
19+
.idea
20+
*.iml
21+
*.ipr
22+
*.iws
23+
classes
24+
gen-external-apklibs
25+
26+
# Gradle
27+
.gradle
28+
build
29+
30+
# Other
31+
.metadata
32+
*/bin/*
33+
*/gen/*
34+
testData
35+
testCache
36+
server.config
37+
38+
# Jacoco
39+
jacoco.exec
40+

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contributing to Parse LiveQuery for Android
2+
We want to make contributing to this project as easy and transparent as possible.
3+
4+
## Code of Conduct
5+
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](https://code.facebook.com/codeofconduct) so that you can understand what actions will and will not be tolerated.
6+
7+
## Our Development Process
8+
Most of our work will be done in public directly on GitHub. There may be changes done through our internal source control, but it will be rare and only as needed.
9+
10+
### `master` is unsafe
11+
Our goal is to keep `master` stable, but there may be changes that your application may not be compatible with. We'll do our best to publicize any breaking changes, but try to use our specific releases in any production environment.
12+
13+
### Pull Requests
14+
We actively welcome your pull requests. When we get one, we'll run some Parse-specific integration tests on it first. From here, we'll need to get a core member to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
15+
16+
1. Fork the repo and create your branch from `master`.
17+
4. Add unit tests for any new code you add.
18+
3. If you've changed APIs, update the documentation.
19+
4. Ensure the test suite passes.
20+
5. Make sure your code lints.
21+
6. If you haven't already, complete the Contributor License Agreement ("CLA").
22+
23+
### Contributor License Agreement ("CLA")
24+
In order to accept your pull request, we need you to submit a CLA. You only need to do this once to work on any of Facebook's open source projects.
25+
26+
Complete your CLA here: <https://developers.facebook.com/opensource/cla>
27+
28+
## Bugs
29+
Although we try to keep developing on Parse easy, you still may run into some issues. General questions should be asked on [Google Groups][google-group], technical questions should be asked on [Stack Overflow][stack-overflow], and for everything else we'll be using GitHub issues.
30+
31+
### Known Issues
32+
We use GitHub issues to track public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new issue, try to make sure your problem doesn't already exist.
33+
34+
### Reporting New Issues
35+
Details are key. The more information you provide us the easier it'll be for us to debug and the faster you'll receive a fix. Some examples of useful tidbits:
36+
37+
* A description. What did you expect to happen and what actually happened? Why do you think that was wrong?
38+
* A simple unit test that fails. Refer [here][tests-dir] for examples of existing unit tests. See our [README](README.md#usage) for how to run unit tests. You can submit a pull request with your failing unit test so that our CI verifies that the test fails.
39+
* What version does this reproduce on? What version did it last work on?
40+
* [Stacktrace or GTFO][stacktrace-or-gtfo]. In all honesty, full stacktraces with line numbers make a happy developer.
41+
* Anything else you find relevant.
42+
43+
### Security Bugs
44+
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue.
45+
46+
## Style Guide
47+
We're still working on providing a code style for your IDE and getting a linter on GitHub, but for now try to keep the following:
48+
49+
* Most importantly, match the existing code style as much as possible.
50+
* Try to keep lines under 100 characters, if possible.
51+
52+
## License
53+
By contributing to Parse Android Parse LiveQuery, you agree that your contributions will be licensed under its license.
54+
55+
[google-group]: https://groups.google.com/forum/#!forum/parse-developers
56+
[stack-overflow]: http://stackoverflow.com/tags/parse.com
57+
[bug-reports]: https://www.parse.com/help#report
58+
[rest-api]: https://www.parse.com/docs/rest/guide
59+
[network-debugging-tool]: https://github.com/ParsePlatform/ParseInterceptors-Android/wiki
60+
[parse-api-console]: http://blog.parse.com/announcements/introducing-the-parse-api-console/
61+
[stacktrace-or-gtfo]: http://i.imgur.com/jacoj.jpg
62+
[tests-dir]: /Parse/src/test/java/com/parse

LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
BSD License
2+
3+
For Parse LiveQueryClient for Android software
4+
5+
Copyright (c) 2015-present, Parse, LLC. All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
16+
17+
* Neither the name Parse nor the names of its contributors may be used to
18+
endorse or promote products derived from this software without specific
19+
prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PATENTS

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Additional Grant of Patent Rights Version 2
2+
3+
"Software" means the Parse Android LiveQuery Client software distributed by Parse, LLC.
4+
5+
Parse, LLC. ("Parse") hereby grants to each recipient of the Software
6+
("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
7+
(subject to the termination provision below) license under any Necessary
8+
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
9+
transfer the Software. For avoidance of doubt, no license is granted under
10+
Parse’s rights in any patent claims that are infringed by (i) modifications
11+
to the Software made by you or any third party or (ii) the Software in
12+
combination with any software or other technology.
13+
14+
The license granted hereunder will terminate, automatically and without notice,
15+
if you (or any of your subsidiaries, corporate affiliates or agents) initiate
16+
directly or indirectly, or take a direct financial interest in, any Patent
17+
Assertion: (i) against Parse or any of its subsidiaries or corporate
18+
affiliates, (ii) against any party if such Patent Assertion arises in whole or
19+
in part from any software, technology, product or service of Parse or any of
20+
its subsidiaries or corporate affiliates, or (iii) against any party relating
21+
to the Software. Notwithstanding the foregoing, if Parse or any of its
22+
subsidiaries or corporate affiliates files a lawsuit alleging patent
23+
infringement against you in the first instance, and you respond by filing a
24+
patent infringement counterclaim in that lawsuit against that party that is
25+
unrelated to the Software, the license granted hereunder will not terminate
26+
under section (i) of this paragraph due to such counterclaim.
27+
28+
A "Necessary Claim" is a claim of a patent owned by Parse that is
29+
necessarily infringed by the Software standing alone.
30+
31+
A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
32+
or contributory infringement or inducement to infringe any patent, including a
33+
cross-claim or counterclaim.

ParseLiveQuery/build.gradle

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
import com.android.builder.core.BuilderConstants
2+
3+
apply plugin: 'com.android.library'
4+
apply plugin: 'com.github.kt3k.coveralls'
5+
6+
group = 'com.parse'
7+
version = '0.0.1-SNAPSHOT'
8+
9+
buildscript {
10+
repositories {
11+
mavenCentral()
12+
}
13+
14+
dependencies {
15+
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1x'
16+
}
17+
}
18+
19+
android {
20+
compileSdkVersion rootProject.ext.compileSdkVersion
21+
buildToolsVersion rootProject.ext.buildToolsVersion
22+
23+
defaultConfig {
24+
minSdkVersion rootProject.ext.minSdkVersion
25+
targetSdkVersion rootProject.ext.targetSdkVersion
26+
versionCode 1
27+
versionName project.version
28+
consumerProguardFiles 'release-proguard.pro'
29+
}
30+
31+
lintOptions {
32+
abortOnError false
33+
}
34+
35+
buildTypes {
36+
debug {
37+
testCoverageEnabled = true
38+
}
39+
}
40+
}
41+
42+
dependencies {
43+
compile 'com.parse:parse-android:1.13.1'
44+
compile 'com.firebase:tubesock:0.0.12'
45+
compile 'com.parse.bolts:bolts-tasks:1.4.0'
46+
47+
testCompile 'org.robolectric:robolectric:3.0'
48+
testCompile 'org.skyscreamer:jsonassert:1.2.3'
49+
testCompile 'org.mockito:mockito-core:1.10.19'
50+
}
51+
52+
android.libraryVariants.all { variant ->
53+
def name = variant.buildType.name
54+
def jar = project.tasks.create(name: "jar${name.capitalize()}", type: Jar) {
55+
dependsOn variant.javaCompile
56+
from variant.javaCompile.destinationDir
57+
58+
manifest {
59+
attributes(
60+
"Bundle-Name": 'parse-livequery-android',
61+
"Bundle-Version": project.version
62+
)
63+
}
64+
65+
exclude '**/R.class'
66+
exclude '**/R\$*.class'
67+
exclude '**/Manifest.class'
68+
exclude '**/Manifest\$*.class'
69+
exclude '**/BuildConfig.class'
70+
}
71+
72+
def javadoc = task("javadoc${variant.name.capitalize()}", type: Javadoc) {
73+
description "Generates Javadoc for $variant.name."
74+
source = variant.javaCompile.source
75+
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
76+
classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar)
77+
78+
options.docletpath = [rootProject.file("./gradle/ExcludeDoclet.jar")]
79+
options.doclet = "me.grantland.doclet.ExcludeDoclet"
80+
81+
options.linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference")
82+
options.links("http://boltsframework.github.io/docs/android/")
83+
84+
exclude '**/BuildConfig.java'
85+
exclude '**/R.java'
86+
exclude '**/internal/**'
87+
}
88+
89+
def javadocJar = task("javadocJar${variant.name.capitalize()}", type: Jar, dependsOn: "javadoc${variant.name.capitalize()}") {
90+
classifier = 'javadoc'
91+
from javadoc.destinationDir
92+
}
93+
94+
if (name.equals(BuilderConstants.RELEASE)) {
95+
artifacts.add('archives', jar);
96+
artifacts.add('archives', javadocJar);
97+
}
98+
}
99+
100+
//region Maven
101+
102+
apply plugin: 'maven'
103+
apply plugin: 'signing'
104+
105+
def isSnapshot = version.endsWith('-SNAPSHOT')
106+
def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : System.getenv('CI_NEXUS_USERNAME')
107+
def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : System.getenv('CI_NEXUS_PASSWORD')
108+
109+
uploadArchives {
110+
repositories.mavenDeployer {
111+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
112+
113+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
114+
authentication(userName: ossrhUsername, password: ossrhPassword)
115+
}
116+
117+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
118+
authentication(userName: ossrhUsername, password: ossrhPassword)
119+
}
120+
121+
pom.project {
122+
name 'Parse-LiveQuery-Android'
123+
artifactId = 'parse-livequery-android'
124+
packaging 'jar'
125+
description 'A library that gives you access to the powerful Parse cloud platform from your Android app.'
126+
url 'https://github.com/ParsePlatform/ParseLiveQuery-Android'
127+
128+
scm {
129+
connection 'scm:[email protected]:ParsePlatform/ParseLiveQuery-Android.git'
130+
developerConnection 'scm:[email protected]:ParsePlatform/ParseLiveQuery-Android.git'
131+
url 'https://github.com/ParsePlatform/ParseLiveQuery-Android'
132+
}
133+
134+
licenses {
135+
license {
136+
name 'BSD License'
137+
url 'https://github.com/ParsePlatform/ParseLiveQuery-Android/blob/master/LICENSE'
138+
distribution 'repo'
139+
}
140+
}
141+
142+
developers {
143+
developer {
144+
id 'parse'
145+
name 'Parse'
146+
}
147+
}
148+
}
149+
}
150+
}
151+
152+
signing {
153+
required { !isSnapshot && gradle.taskGraph.hasTask("uploadArchives") }
154+
sign configurations.archives
155+
}
156+
157+
task androidSourcesJar(type: Jar) {
158+
classifier = 'sources'
159+
from android.sourceSets.main.java.sourceFiles
160+
}
161+
162+
artifacts {
163+
archives androidSourcesJar
164+
}
165+
166+
//endregion
167+
168+
//region Code Coverage
169+
170+
apply plugin: 'jacoco'
171+
172+
jacoco {
173+
toolVersion "0.7.1.201405082137"
174+
}
175+
176+
task jacocoTestReport(type:JacocoReport, dependsOn: "testDebugUnitTest") {
177+
group = "Reporting"
178+
description = "Generate Jacoco coverage reports"
179+
180+
classDirectories = fileTree(
181+
dir: "${buildDir}/intermediates/classes/debug",
182+
excludes: ['**/R.class',
183+
'**/R$*.class',
184+
'**/*$ViewInjector*.*',
185+
'**/BuildConfig.*',
186+
'**/Manifest*.*']
187+
)
188+
189+
sourceDirectories = files("${buildDir.parent}/src/main/java")
190+
additionalSourceDirs = files([
191+
"${buildDir}/generated/source/buildConfig/debug",
192+
"${buildDir}/generated/source/r/debug"
193+
])
194+
executionData = files("${buildDir}/jacoco/testDebugUnitTest.exec")
195+
196+
reports {
197+
xml.enabled = true
198+
html.enabled = true
199+
}
200+
}
201+
202+
//endregion
203+
204+
//region Coveralls
205+
206+
coveralls.jacocoReportPath = "${buildDir}/reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
207+
208+
//endregion

0 commit comments

Comments
 (0)