Skip to content

Commit

Permalink
Add a gradle plugin
Browse files Browse the repository at this point in the history
Resolves #20
  • Loading branch information
Justin Brooks committed Feb 16, 2021
1 parent 53b4251 commit f08ad75
Show file tree
Hide file tree
Showing 107 changed files with 1,024 additions and 214 deletions.
31 changes: 31 additions & 0 deletions .github/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ vgo is a tool for optimizing vector artwork files that helps ensure your vector

Download the distribution from the releases page and ensure it has execute permission. On macOS & Linux run `chmod +x vgo`.

## Gradle Plugin
Add the plugin to your buildscript classpath.
```
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.jzbrooks:vgo-plugin:1.4.0"
}
}
```

Then, in the relevant project, add the plugin.
```
plugins {
id 'com.jzbrooks.vgo'
}
vgo {
inputs = fileTree(projectDir) {
include '**/res/drawable*/*.xml'
}
outputs = inputs
showStatistics = true
format = OutputFormat.UNCHANGED
indent = 0
}
```

## Command Line Interface

```
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/gradle.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
with:
name: vgo_core_test_results
path: vgo-core/build/reports/tests/test/
- name: archive integration test results
uses: actions/upload-artifact@v1
with:
name: integration_test_results
path: vgo/build/reports/tests/integrationTest
- name: release binary
run: ./gradlew binary
- name: archive vgo
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: publish

on:
release:
types: [released]

jobs:
publish:
name: Release build and publish
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: set up JDK
id: setup-jdk
uses: actions/setup-java@v1
with:
java-version: 11

- name: Create binary keyring
env:
GPG_KEY_CONTENTS: ${{ secrets.SIGNING_KEY_SECRET }}
SIGNING_KEY_RING_FILE: ${{ secrets.SIGNING_KEY_FILE_PATH }}
run: |
git fetch --unshallow
sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_KEY_RING_FILE'"
- name: Publish to MavenCentral
run: ./gradlew --max-workers 1 --no-daemon publishReleasePublicationToSonatypeRepository closeAndReleaseRepository
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_KEY_FILE_PATH: ${{ secrets.SIGNING_KEY_FILE_PATH }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_PROFILE_ID: ${{ secrets.SONATYPE_PROFILE_ID }}
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/Gradle__com_jzbrooks_vgo_1_4_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/Gradle__com_jzbrooks_vgo_core_1_4_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules/vgo-core/vgo.vgo-core.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/modules/vgo-core/vgo.vgo-core.test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/modules/vgo-plugin.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/modules/vgo-plugin/vgo.vgo-plugin.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f08ad75

Please sign in to comment.