Skip to content

Native Android .aar extraction from com.cordova.plugins.cookiemaster.CookieMaster for reuse in native Android as well as Cordova using the Android Studio Library directory structure.

License

Notifications You must be signed in to change notification settings

gregswindle/cookiemaster-android-lib

Repository files navigation

cookiemaster-android-lib

Native Android extraction from com.cordova.plugins.cookiemaster.CookieMaster for reuse in native Android as well as Cordova.

Build Status codecov Quality Gate Dependency Status Technical Debt

1. Features

1.1. Get a cookie by URL and name

String url = "https://example.com/cookies";
String cookieName = "foo";
HttpCookie cookie = CookieMaster.getCookieValue(url, cookieName);

1.2. Set a cookie by URL and name

String url = "https://example.com/cookies";
String cookieName = "foo";
String cookieValue = "bar";
CookieMaster.getCookieValue(url, cookieName, cookieValue);

1.3. Set a cookie with JSON

// json is a serialized HttpCookie
HttpCookie cookie = CookieMaster.cookieFromJson(json);

1.4. Serialize an HttpCookie to JSON

// cookie is an HttpCookie
String jsonCookie = CookieMaster.cookieToJson(cookie);

1.5. Clear all cookies

CookieMaster.clear();

2. Setup

Releases are will be published to bintray jcenter and maven central.

License JCenter Maven Central

2.1. Maven

<dependency>
  <groupId>com.verizon.api</groupId>
  <artifactId>cookiemaster-android-lib</artifactId>
  <version>0.1.0</version>
</dependency>

2.2. Gradle

Add com.verizon.api:cookiemaster-android-lib to your build.gradle's dependencies:

compile 'com.verizon.api:cookiemaster-android-lib:0.1.0'

3. Snapshots

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).

4. Recommended prerequisites

The following dependencies are recommended for consistent build, test, and deploy tasks:

Install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

4.2. jenv

Install jenv:

$ brew install jenv

4.3. java

Install Java from a Terminal:

$ brew cask install java

βœ… Install several versions of 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

5. Reports πŸ“ˆ

βœ… Generate a project report

Generate project reports for all dependencies, properties, and tasks in your <project-root>/build/reports/project directory:

$ ./gradlew projectReport

5.1. Code quality and test reports

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

5.2. Project dependency updates

Checks whether your project is using the latest available versions in its dependencies. If not, you'll see which upgrades are available.

$ ./gradlew dependencyUpdates

5.3. Project dependencies tree in a Terminal

Print the product's dependency tree in your console.

$ ./gradlew dependencies

5.4. Dependency reports for Web browsers

Generate a Dependency Report in HTML and launch it in your default browser.

βœ… Analyze dependency conflicts

To analyze conflicts, click on dependency name to activate a dependencyInsight pop-up in the Dependency Report.

$ ./gradlew showDependenciesTree

6. Dependency management

πŸ”— Install libraries to your local maven repository. Useful for referencing by other projects (for testing without releasing library).

$ ./gradlew install

7. Deployment

🌐 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

java lib generator

About

Native Android .aar extraction from com.cordova.plugins.cookiemaster.CookieMaster for reuse in native Android as well as Cordova using the Android Studio Library directory structure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published