• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

cookpad/LicenseToolsPlugin: Gradle plugin to check library licenses and generate ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

cookpad/LicenseToolsPlugin

开源软件地址(OpenSource Url):

https://github.com/cookpad/LicenseToolsPlugin

开源编程语言(OpenSource Language):

HTML 86.6%

开源软件介绍(OpenSource Introduction):

DEPRECATED

"LicenseToolsPlugin" is no longer used internally at Cookpad. No more development will be taking place. As an alternative, we recommend OSS Licenses Gradle Plugin.

Thanks for all your support!

License Tools Plugin for Android

Actions Status License Gradle Plugin Portal

This repository is a replacement project of cookpad/license-tools-plugin written with kotlin

License List(sample)

Setup

Recommend

plugins {
  id "com.cookpad.android.plugin.license-tools" version "${latest_version}"
}

If you use legacy gradle project

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.cookpad.android.plugin:plugin:${latest_version}"
  }
}

apply plugin: "com.cookpad.android.plugin.license-tools"

Learn how to apply plugins to subprojects

Gradle tasks

This Plugin provite to check library licenses and generate license pages.

  • ./gradlew checkLicenses to check licenses in dependencies
  • ./gradlew updateLicenses to update library information file licenses.yml
  • ./gradlew generateLicensePage to generate a license page licenses.html
  • ./gradlew generateLicenseJson to generate a license json file licenses.json

How To Use

Run the checkLicenses task

You will see the following messages by ./gradlew checkLicenses:

# Libraries not listed:
- artifact: androidx.annotation:annotation:+
  name: Android Support Library Annotations
  copyrightHolder: #COPYRIGHT HOLDER#
  license: The Apache Software License, Version 2.0
  url: http://developer.android.com/tools/extras/support-library.html
  licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
- artifact: io.reactivex.rxjava2:rxjava:+
  name: rxjava
  copyrightHolder: #COPYRIGHT HOLDER#
  license: The Apache Software License, Version 2.0
  url: https://github.com/ReactiveX/RxJava2

Add library licenses to app/licenses.yml

Then, Create app/licenses.yml, and add libraries listed the above with required fields:

- artifact: androidx.annotation:annotation:+
  name: Android Support Library Annotations
  copyrightHolder: Google Inc.
  license: The Apache Software License, Version 2.0
  url: http://developer.android.com/tools/extras/support-library.html
  licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
- artifact: io.reactivex.rxjava2:rxjava:+
  name: rxjava
  copyrightHolder: Netflix, Inc.
  license: The Apache Software License, Version 2.0
  url: https://github.com/ReactiveX/RxJava2

You can use wildcards in artifact names and versions. You'll know the Android support libraries are grouped in androidx.annotation:annotation so you use androidx.annotation:annotation:+:+ here.

Then, ./gradlew checkLicenses will passes.

Generate licenses.html by the generateLicensePage task

./gradlew generateLicensePage generates app/src/main/assets/licenses.html.

This plugin does not provide Activity nor Fragment to show licenses.html. You should add it by yourself.

example/MainActivity is an example.

Configuring the plugin

Use licenseTools in your build.gradle to add some optional configuration.

For example:

licenseTools {
    outputHtml = "licenses_output.html"
}

Available configuration fields:

Field name Default value Description
licensesYaml "licenses.yml" The name of the licenses yml file
outputHtml "licenses.html" The file name of the output of the generateLicensePage task
outputJson "licenses.json" The file name of the output of the generateLicenseJson task
ignoredGroups [] (empty array) An array of group names the plugin will ignore (useful for internal dependencies with missing .pom files)
ignoredProjects [] (empty array) An array of project names the plugin will ignore (To ignore particular internal projects like custom lint)

DataSet Format

Required Fields

  • artifact
  • name
  • Either copyrightHolder, author, authors or notice

Optional Fields

  • year to indicate copyright years
  • skip to skip generating license entries (for proprietary libraries)
  • forceGenerate to force generate the output with arbitrary items. (Read [this issue](Feature Request: feature for adding/changing licenses by hand #78) for more details.)
    • If some pom data is wrong, you can override some of them using this flag.

Sample

- artifact: androidx.annotation:annotation:+
  name: Android Support Library Annotations
  copyrightHolder: Google Inc.
  license: The Apache Software License, Version 2.0
  url: http://developer.android.com/tools/extras/support-library.html
  licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
- artifact: androidx.appcompat:appcompat:+
  name: Android AppCompat Library v7
  copyrightHolder: Google Inc.
  license: The Apache Software License, Version 2.0
  url: http://developer.android.com/tools/extras/support-library.html
  licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
- artifact: com.github.bumptech.glide:glide:+
  name: Glide
  copyrightHolder: Sam Judd
  license: Simplified BSD License
  url: https://github.com/bumptech/glide
  licenseUrl: http://www.opensource.org/licenses/bsd-license

Release Engineering

  1. Update CHANGELOG.md & Commit
  2. git tag $next_version (i.g. git tag 1.2.0)
  3. git push orgin master --tags
  4. Fire publish action (automatically)

After that check https://plugins.gradle.org/plugin/com.cookpad.android.plugin.license-tools




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
SIERRA-880/gradle_template: A Gradle template with JavaFX发布时间:2022-06-14
下一篇:
ww23/BlindWatermark: Java 盲水印发布时间:2022-06-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap