GithubHelp home page GithubHelp logo

underwindfall / zeplin-asset-download-gradle Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 0.0 337 KB

A simple gradle plugin that lets you create a download asset from zeplin and convert them to vector drawables automatically elephant project using 100% Kotlin and be up and running in a few seconds.

License: Apache License 2.0

Kotlin 100.00%
download gradle-kotlin-dsl gradle-plugin vector vector-drawable zeplin zeplin-api svg svg-vector-drawable

zeplin-asset-download-gradle's Introduction

zeplin-asset-download-gradle-plugin ๐Ÿ˜

A simple gradle plugin that lets you create a download asset from zeplin and convert them to vector drawables automatically ๐Ÿ˜ project using 100% Kotlin and be up and running in a few seconds.

How to use ๐Ÿ‘ฃ

The plugin is developed based on Zeplin API, it's used zeplin OAuth2 to verify the project have correct access.

try to add the plugin to the project.gradle you want to use,

groovy
plugins {
    ...
    id("io.github.underwindfall.zeplin.gradle")
}

zeplinConfig {
    zeplinToken = "input the correct zeplin token"
    configFile = file("input the correct zeplin file")
}
kotlin
plugins {
    ...
    id("io.github.underwindfall.zeplin.gradle")
}

zeplinConfig {
    zeplinToken.set("input the correct zeplin token")
    configFile.set(file("input the correct zeplin file"))
}

then execute the script that's it !

./gradlew your_project:updateZeplin

Zeplin Developer Token ๐Ÿ”

To use this plugin, you either need to create a personal access token or a Zeplin app. You can create them from the web app under Developer tab in your profile page. zeplin developer token

Configuration โš™๏ธ

Before starting directly zeplin script, besides that zeplin token above, we also need a configuration file to tell plugin which kind of assets the plugin want to download.

{
  "projectId": "input the zeplin project id",
  "tagName": [],
  "outputDir": "",
  "resourcePrefix": "",
  "deniedList": {
    "screen_ids": []
  },
  "allowList": {
    "screen_ids": [""]
  }
}
Attributes Meaning Example to get the information
projectId id of zeplin project
tagName tag of screens which allow you download the assets with the same name collection
outputDir output directory where you want to assign plugin to put converted assets into
resourcePrefix android resource prefix to avoid resource conflicts
deniedList denied list screens in case some of screens you want to include
allowList denied list screens in case some of screens you want to exclude

Example ๐Ÿ“ฆ

The example project is to display how the zeplin works and what kind of configuration needs to be added you can check it in example folder.

Features ๐ŸŽจ

  • 100% Kotlin-only.
  • Zeplin API and vector drawable converted automatically
  • Plugin build setup with composite build.
  • CI Setup with GitHub Actions.

Contributing ๐Ÿค

Feel free to open an issue or submit a pull request for any bugs/improvements. This plugin is based on static analysis check, you can use preMerge task to test it.

A preMerge task on the top level build is already provided in the project. This allows you to run all the check tasks both in the top level and in the included build.

You can easily invoke it with:

./gradlew preMerge

If you need to invoke a task inside the included build with:

./gradlew -p plugin-build <task-name>

License ๐Ÿ“„

This template is licensed under the Apache License - see the License file for details. Please note that the generated template is offering to start with a MIT license but you can change it to whatever you wish, as long as you attribute under the MIT terms that you're using the template.

zeplin-asset-download-gradle's People

Contributors

underwindfall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zeplin-asset-download-gradle's Issues

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.