Skip to content

Commit

Permalink
Initial project
Browse files Browse the repository at this point in the history
  • Loading branch information
mmimeault committed Oct 7, 2016
1 parent 4d01542 commit 6830bbc
Show file tree
Hide file tree
Showing 30 changed files with 2,177 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# Android Studio
.idea
*.iml
*.ipr
*.iws
classes
gen-external-apklibs

# Gradle
.gradle
build

# Other
.metadata
*/bin/*
*/gen/*
testData
testCache
server.config

# Jacoco
jacoco.exec

62 changes: 62 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Contributing to Parse LiveQuery for Android
We want to make contributing to this project as easy and transparent as possible.

## Code of Conduct
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.

## Our Development Process
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.

### `master` is unsafe
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.

### Pull Requests
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.

1. Fork the repo and create your branch from `master`.
4. Add unit tests for any new code you add.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. If you haven't already, complete the Contributor License Agreement ("CLA").

### Contributor License Agreement ("CLA")
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.

Complete your CLA here: <https://developers.facebook.com/opensource/cla>

## Bugs
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.

### Known Issues
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.

### Reporting New Issues
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:

* A description. What did you expect to happen and what actually happened? Why do you think that was wrong?
* 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.
* What version does this reproduce on? What version did it last work on?
* [Stacktrace or GTFO][stacktrace-or-gtfo]. In all honesty, full stacktraces with line numbers make a happy developer.
* Anything else you find relevant.

### Security Bugs
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.

## Style Guide
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:

* Most importantly, match the existing code style as much as possible.
* Try to keep lines under 100 characters, if possible.

## License
By contributing to Parse Android Parse LiveQuery, you agree that your contributions will be licensed under its license.

[google-group]: https://groups.google.com/forum/#!forum/parse-developers
[stack-overflow]: http://stackoverflow.com/tags/parse.com
[bug-reports]: https://www.parse.com/help#report
[rest-api]: https://www.parse.com/docs/rest/guide
[network-debugging-tool]: https://github.com/ParsePlatform/ParseInterceptors-Android/wiki
[parse-api-console]: http://blog.parse.com/announcements/introducing-the-parse-api-console/
[stacktrace-or-gtfo]: http://i.imgur.com/jacoj.jpg
[tests-dir]: /Parse/src/test/java/com/parse
30 changes: 30 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD License

For Parse LiveQueryClient for Android software

Copyright (c) 2015-present, Parse, LLC. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name Parse nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 changes: 33 additions & 0 deletions PATENTS
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Additional Grant of Patent Rights Version 2

"Software" means the Parse Android LiveQuery Client software distributed by Parse, LLC.

Parse, LLC. ("Parse") hereby grants to each recipient of the Software
("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
(subject to the termination provision below) license under any Necessary
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
transfer the Software. For avoidance of doubt, no license is granted under
Parse’s rights in any patent claims that are infringed by (i) modifications
to the Software made by you or any third party or (ii) the Software in
combination with any software or other technology.

The license granted hereunder will terminate, automatically and without notice,
if you (or any of your subsidiaries, corporate affiliates or agents) initiate
directly or indirectly, or take a direct financial interest in, any Patent
Assertion: (i) against Parse or any of its subsidiaries or corporate
affiliates, (ii) against any party if such Patent Assertion arises in whole or
in part from any software, technology, product or service of Parse or any of
its subsidiaries or corporate affiliates, or (iii) against any party relating
to the Software. Notwithstanding the foregoing, if Parse or any of its
subsidiaries or corporate affiliates files a lawsuit alleging patent
infringement against you in the first instance, and you respond by filing a
patent infringement counterclaim in that lawsuit against that party that is
unrelated to the Software, the license granted hereunder will not terminate
under section (i) of this paragraph due to such counterclaim.

A "Necessary Claim" is a claim of a patent owned by Parse that is
necessarily infringed by the Software standing alone.

A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
or contributory infringement or inducement to infringe any patent, including a
cross-claim or counterclaim.
208 changes: 208 additions & 0 deletions ParseLiveQuery/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
import com.android.builder.core.BuilderConstants

apply plugin: 'com.android.library'
apply plugin: 'com.github.kt3k.coveralls'

group = 'com.parse'
version = '0.0.1-SNAPSHOT'

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1x'
}
}

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName project.version
consumerProguardFiles 'release-proguard.pro'
}

lintOptions {
abortOnError false
}

buildTypes {
debug {
testCoverageEnabled = true
}
}
}

dependencies {
compile 'com.parse:parse-android:1.13.1'
compile 'com.firebase:tubesock:0.0.12'
compile 'com.parse.bolts:bolts-tasks:1.4.0'

testCompile 'org.robolectric:robolectric:3.0'
testCompile 'org.skyscreamer:jsonassert:1.2.3'
testCompile 'org.mockito:mockito-core:1.10.19'
}

android.libraryVariants.all { variant ->
def name = variant.buildType.name
def jar = project.tasks.create(name: "jar${name.capitalize()}", type: Jar) {
dependsOn variant.javaCompile
from variant.javaCompile.destinationDir

manifest {
attributes(
"Bundle-Name": 'parse-livequery-android',
"Bundle-Version": project.version
)
}

exclude '**/R.class'
exclude '**/R\$*.class'
exclude '**/Manifest.class'
exclude '**/Manifest\$*.class'
exclude '**/BuildConfig.class'
}

def javadoc = task("javadoc${variant.name.capitalize()}", type: Javadoc) {
description "Generates Javadoc for $variant.name."
source = variant.javaCompile.source
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar)

options.docletpath = [rootProject.file("./gradle/ExcludeDoclet.jar")]
options.doclet = "me.grantland.doclet.ExcludeDoclet"

options.linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference")
options.links("http://boltsframework.github.io/docs/android/")

exclude '**/BuildConfig.java'
exclude '**/R.java'
exclude '**/internal/**'
}

def javadocJar = task("javadocJar${variant.name.capitalize()}", type: Jar, dependsOn: "javadoc${variant.name.capitalize()}") {
classifier = 'javadoc'
from javadoc.destinationDir
}

if (name.equals(BuilderConstants.RELEASE)) {
artifacts.add('archives', jar);
artifacts.add('archives', javadocJar);
}
}

//region Maven

apply plugin: 'maven'
apply plugin: 'signing'

def isSnapshot = version.endsWith('-SNAPSHOT')
def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : System.getenv('CI_NEXUS_USERNAME')
def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : System.getenv('CI_NEXUS_PASSWORD')

uploadArchives {
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name 'Parse-LiveQuery-Android'
artifactId = 'parse-livequery-android'
packaging 'jar'
description 'A library that gives you access to the powerful Parse cloud platform from your Android app.'
url 'https://github.com/ParsePlatform/ParseLiveQuery-Android'

scm {
connection 'scm:[email protected]:ParsePlatform/ParseLiveQuery-Android.git'
developerConnection 'scm:[email protected]:ParsePlatform/ParseLiveQuery-Android.git'
url 'https://github.com/ParsePlatform/ParseLiveQuery-Android'
}

licenses {
license {
name 'BSD License'
url 'https://github.com/ParsePlatform/ParseLiveQuery-Android/blob/master/LICENSE'
distribution 'repo'
}
}

developers {
developer {
id 'parse'
name 'Parse'
}
}
}
}
}

signing {
required { !isSnapshot && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}

artifacts {
archives androidSourcesJar
}

//endregion

//region Code Coverage

apply plugin: 'jacoco'

jacoco {
toolVersion "0.7.1.201405082137"
}

task jacocoTestReport(type:JacocoReport, dependsOn: "testDebugUnitTest") {
group = "Reporting"
description = "Generate Jacoco coverage reports"

classDirectories = fileTree(
dir: "${buildDir}/intermediates/classes/debug",
excludes: ['**/R.class',
'**/R$*.class',
'**/*$ViewInjector*.*',
'**/BuildConfig.*',
'**/Manifest*.*']
)

sourceDirectories = files("${buildDir.parent}/src/main/java")
additionalSourceDirs = files([
"${buildDir}/generated/source/buildConfig/debug",
"${buildDir}/generated/source/r/debug"
])
executionData = files("${buildDir}/jacoco/testDebugUnitTest.exec")

reports {
xml.enabled = true
html.enabled = true
}
}

//endregion

//region Coveralls

coveralls.jacocoReportPath = "${buildDir}/reports/jacoco/jacocoTestReport/jacocoTestReport.xml"

//endregion
Loading

0 comments on commit 6830bbc

Please sign in to comment.