Skip to content

Commit

Permalink
Fix homebrew install directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ghokun committed Feb 13, 2023
1 parent 6c64c9c commit 07fdbae
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ This is a data file converter that supports following files:
- [TOML](https://toml.io/en/)
- [properties](https://en.wikipedia.org/wiki/.properties)

## Install

```shell
brew install ghokun/tap/convert

# or
brew tap ghokun/tap
brew install convert

# Windows users can download from releases page
```

## Usage

```bash
Expand Down
24 changes: 19 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,30 @@ final class VersionProvider implements picocli.CommandLine.IVersionProvider {
}
}

tasks.register("generatePackage", Zip) {
def osName = os.isMacOsX() ? os.getNativePrefix() : os.getFamilyName()
def arch = System.getProperty("os.arch")
def archiveName = "${project.name}-${project.version}-${osName}-${arch == 'amd64' ? 'x86_64' : arch}"

tasks.register("copyBinaries", Copy) {
group = taskGroup
dependsOn("nativeCompile")

def osName = os.isMacOsX() ? os.getNativePrefix() : os.getFamilyName()
def arch = System.getProperty("os.arch")
archiveFileName = "${project.name}-${project.version}-${osName}-${arch == 'amd64' ? 'x86_64' : arch}.zip"
def binDir = file("${buildDir}/native/${archiveName}/bin/")
binDir.parentFile.mkdirs()

from os.isWindows() ? "${buildDir}/native/nativeCompile/convert.exe" : "${buildDir}/native/nativeCompile/convert"
into binDir
}

tasks.register("generatePackage", Zip) {
group = taskGroup
dependsOn("copyBinaries")

archiveFileName = "${archiveName}.zip"
destinationDirectory = layout.buildDirectory.dir("dist")

from layout.buildDirectory.files("native/nativeCompile/convert", "native/nativeCompile/convert.exe")
from layout.buildDirectory.dir("native")
include "${archiveName}/**"
}

sourceSets.main.java.srcDirs += generatedSources
Expand Down

0 comments on commit 07fdbae

Please sign in to comment.