Giter Club home page Giter Club logo

easygradle's Introduction

EasyGradle

EasyGradle is a set of utilities for simply the Gradle configuration.

It includes:

  • Gradle DSL+
  • EasyPublish on Bintray plugin for Java, Kotlin & Kotlin Multiplatform!
Version 1.x includes also ( few ) utils for Dokka which are not included yet in 2.x - it's still need to be evaluated whether a dedicated package for it is worth to be distributed. 1.x readme here

DSL+

It's mean to be included in the buildSrc module in the following way:

api("studio.forface.easygradle:dsl:$dslVersion")

or

api("studio.forface.easygradle:dsl-android:$dslVersion")

Features:

  • Library and Plugin dependencies ( check docs for full list )

    repositories {
      classpath(`kotlin-gradle-plugin`)
      classpath(`serialization-gradle-plugin`)
      // etc
    }
    
    dependencies {
      implementation(`kotlin-js` version "1.3.50" ) // version is optional
      implementation(`constraint-layout`)
      testImplementation(`mockk`)
      // etc
    }
  • External versions declaration

    fun initVersions() {
      `kotlin version` =        "1.3.50"        // Updated: Aug 22, 2019
      `espresso version` =      "3.2.0"         // Updated: May 30, 2019
      `lifecycle version` =     "2.2.0-alpha03" // Updated: Aug 09, 2019
      `material version` =      "1.1.0-alpha07" // Updated: May 31, 2019
      `android-test version` =  "1.2.0"         // Updated: May 31, 2019
    }

    This is a good idea to be called at the start of your buildscript

    buildscript {
      initVersions()
      ...
    }
  • Configuration accessors DSL

    api(
      `kotlin-jdk7`,
      `serialization`,
      // etc
    )
    implementation(
      `kotlin-reflect`,
      `coroutines-android`,
      // etc
    )
  • exclude extensions

    androidTestImplementation(
      `android-test`,
      `mockk-android` exclude `mockk`,
      `junit4` exclude jUnit5(`any`) and "another:lib"
    )
  • versioning, it is also compatible with Android for automatically generate versionName and versionCode from the given major, minor, channel, patch and build versions ( see Version )

    It can also be used by following ( avoiding to pass versionName and versionCode )

    android {
      defaultConfig {
        version = Version(1, 2, Beta, 2, 0)
      }
    }

EasyPublis plugin for Bintray ( wraps maven-publish )

Support Jvm, Android and Multiplatform

Apply with DSL

plugins {
  id("studio.forface.easy-publish") version easyPublishVersion
}

Apply with legacy

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("gradle.plugin.EasyGradle-publish:plugin:0.2.1")
  }
}

apply(plugin = "studio.forface.easy-publish")

Usage

Configure into your gradle and use ./gradlew uploadArchives

// build.gradle.kts
...
easyPublish {
  // optional config
}
  • It fetches params from your Project's properties ( group, name, version, etc or declared in gradle.properties file - see template - relative to the module or root )

  • or fetches from environment variables

  • or declared in DSL style

    easyPublish {
      artifact = "dsl"
      developers {
        developer {
          name = "Davide"
          id = "4face-studi0"
          email = "[email protected]"
        }
      }
      ...
    }
  • a default block could be stored and reused

    val config = PublishConfig { project ->
      version = Version(1, 2, Beta, 2, 0)
      ...
    }
    
    publish(config) {
      // optional additional block
    }
  • More to come

easygradle's People

Contributors

fardavide avatar

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.