Native Android extraction from
com.cordova.plugins.cookiemaster.CookieMaster
for reuse in native Android as well as Cordova.
- 1. Features
- 2. Setup
- 3. Snapshots
- 4. Recommended prerequisites
- 5. Reports π
- 6. Dependency management
- 7. Deployment
String url = "https://example.com/cookies";
String cookieName = "foo";
HttpCookie cookie = CookieMaster.getCookieValue(url, cookieName);
String url = "https://example.com/cookies";
String cookieName = "foo";
String cookieValue = "bar";
CookieMaster.getCookieValue(url, cookieName, cookieValue);
// json is a serialized HttpCookie
HttpCookie cookie = CookieMaster.cookieFromJson(json);
// cookie is an HttpCookie
String jsonCookie = CookieMaster.cookieToJson(cookie);
CookieMaster.clear();
Releases are will be published to bintray jcenter and
maven central.
<dependency>
<groupId>com.verizon.api</groupId>
<artifactId>cookiemaster-android-lib</artifactId>
<version>0.1.0</version>
</dependency>
Add com.verizon.api:cookiemaster-android-lib
to your build.gradle
's dependencies
:
compile 'com.verizon.api:cookiemaster-android-lib:0.1.0'
You can use snapshot versions through JitPack.
3.1. Go to JitPack project page.
3.2. Select Commits
section and click Get it
on commit you want to use (top one - the most recent).
3.3. Follow displayed instructions: add repository and change dependency (NOTE: due to JitPack convention artifact group will be different).
The following dependencies are recommended for consistent build, test, and deploy tasks:
4.1. Homebrew
Install Homebrew
:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
4.2. jenv
Install jenv
:
$ brew install jenv
Install Java
from a Terminal:
$ brew cask install java
If you want to test this library on several versions of
Java
, the article Install Multiple Java Versions on Mac provides clear yet detailed instructions.
4.4. gradle
Install gradle
for automated build and dependency management:
$ brew install gradle
Generate project reports for all dependencies, properties, and tasks in your
<project-root>/build/reports/project
directory:$ ./gradlew projectReport
Use the following command to run code quality plugins and tests. If quality checks were activated (asked during generation) do check before pushing to avoid build failures on travis. Moreover, it's easy to always keep everything clean instead of doing it before release.
$ ./gradlew check
Checks whether your project is using the latest available versions in its dependencies. If not, you'll see which upgrades are available.
$ ./gradlew dependencyUpdates
Print the product's dependency tree in your console.
$ ./gradlew dependencies
Generate a Dependency Report in HTML
and launch it in your default browser.
To analyze conflicts, click on dependency name to activate a
dependencyInsight
pop-up in the Dependency Report.
$ ./gradlew showDependenciesTree
π Install libraries to your local maven
repository. Useful for referencing by other projects (for testing without releasing library).
$ ./gradlew install
π Publish the library to jFrog Bintray (and therefore the world).
β οΈ Read the Release process first!Before publishing the library, read the section Release process in the
generator-lib-java
README.md.
$ ./gradlew release