Giter Site home page Giter Site logo

release-watcher's Introduction

Release Watcher

A small API to request github releases (<10 kb size).
Methods of release are inspired by python's version info.

Supports Gson as deserializer of http requests (Jackson and other libs can be adapted).

Usage

import me.oczi.release.GithubReleases;
import me.oczi.release.Release;

class MyClass {

    public static void main(String[] args) {
        // Create the service to request releases
        GsonReleaseService service = new GsonReleaseService(
            GithubReleases.of("OcZi", "Margaret") // Build the release URL of the repository
        );
        // Wait CompletableFuture to finish
        Release[] releases = service.requestLastRelease().join();
        // Github will return it in date order
        Release lastRelease = releases[0];

        // New version found?
        if (lastRelease.isGreaterThan(0, 8)) {
            System.out.println("New version available: " + lastRelease.getVersion());
        }
    }
}

Dependency

Maven:

<repositories>
    <repository>
        <id>unnamed-snapshots</id>
        <url>https://repo.unnamed.team/repository/unnamed-snapshots/</url>
    </repository>
</repositories>


<dependencies>
    <!-- Without deserializer -->
    <dependency>
        <groupId>me.oczi</groupId>
        <artifactId>release-watcher-api</artifactId>
        <version>1.0-SNAPSHOT</version>
        <scope>compile</scope>
    </dependency>

    <!-- Gson deserializer -->
    <!-- It compiles API too -->
    <dependency>
        <groupId>me.oczi</groupId>
        <artifactId>release-watcher-gson</artifactId>
        <version>1.0-SNAPSHOT</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

Gradle:

repositories {
    maven { url 'https://repo.unnamed.team/repository/unnamed-snapshots/' }
}

// Without deserializer
compileOnly('me.oczi:release-watcher-api:1.0-SNAPSHOT')

// Gson deserializer
// It compiles API too
compileOnly('me.oczi:release-watcher-gson:1.0-SNAPSHOT')

Build

JDK: Minimum 8
Gson: Minimum 2.2.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.