Skip to content

Commit

Permalink
Build configuration for Mac and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nukisman committed Sep 25, 2017
1 parent 31ab4b8 commit f0179c3
Show file tree
Hide file tree
Showing 13 changed files with 110 additions and 28 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
/tests/elm-format-short
.idea
debug.txt
debug.elm
debug.elm
dist
elm-format-short-*.tgz
.vagrant
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## 0.8.0
## 0.8.3

Fork `elm-format-short` from `elm-format`
TODO: Features added
TODO: Format changes

## master (0.7.1-beta)

Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at gruen0aermel@gmail.com. All
reported by contacting the project team at nukisman@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
6 changes: 4 additions & 2 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

```bash
brew update
brew install keybase
brew tap caskroom/cask
brew cask install keybase
brew install github-release
brew install caskroom/cask/brew-cask
brew cask install vagrant
brew cask install virtualbox
brew install gpg
```


Expand Down Expand Up @@ -58,6 +59,7 @@ brew cask install virtualbox

```
cd package/npm
npm i
# for experimental releases
# npm publish --tag exp
npm publish
Expand Down
70 changes: 70 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "opentable/win-2012r2-standard-amd64-nocm"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
end
2 changes: 1 addition & 1 deletion elm-format-short.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: elm-format-short
version: 0.8.0
version: 0.8.3

Synopsis:
A source code short formatter for Elm
Expand Down
17 changes: 9 additions & 8 deletions package/collect_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ VERSION="$(git describe --abbrev=8)"

## Collect files

pushd package/win/elm-format-short
tar zxvf "elm-format-short-0.17-${VERSION}-win-i386.tgz"
zip "elm-format-short-0.17-${VERSION}-win-i386.zip" elm-format-short.exe
tar zxvf "elm-format-short-0.18-${VERSION}-win-i386.tgz"
zip "elm-format-short-0.18-${VERSION}-win-i386.zip" elm-format-short.exe
popd
#pushd package/win/elm-format-short
#tar zxvf "elm-format-short-0.17-${VERSION}-win-i386.tgz"
#zip "elm-format-short-0.17-${VERSION}-win-i386.zip" elm-format-short.exe
#tar zxvf "elm-format-short-0.18-${VERSION}-win-i386.tgz"
#zip "elm-format-short-0.18-${VERSION}-win-i386.zip" elm-format-short.exe
#popd

cp -v package/win/elm-format-short/elm-format-short-*-"${VERSION}"-win-i386.zip ./
#cp -v package/win/elm-format-short/elm-format-short-*-"${VERSION}"-win-i386.zip ./

for i in elm-format-short-{0.17,0.18}-${VERSION}-{mac-x64.tgz,win-i386.zip,linux-x64.tgz}; do
#for i in elm-format-short-{0.17,0.18}-${VERSION}-{mac-x64.tgz,win-i386.zip,linux-x64.tgz}; do
for i in elm-format-short-{0.17,0.18}-${VERSION}-{mac-x64.tgz,linux-x64.tgz}; do
keybase pgp sign --detached --infile "$i" --outfile "$i".asc
# github-release upload --user avh4 --repo elm-format-short --tag "$VERSION" --file "$BUILD".tgz
# github-release upload --user avh4 --repo elm-format-short --tag "$VERSION" --file "$BUILD".tgz.asc
Expand Down
2 changes: 1 addition & 1 deletion package/linux/build-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -ex

docker build -t elm-format-short-dev-linux .
docker run -v "$(pwd)":/elm-format-short -w /elm-format elm-format-short-dev-linux ./package/linux/build-package.sh
docker run -v "$(pwd)":/elm-format-short -w /elm-format-short elm-format-short-dev-linux ./package/linux/build-package.sh
2 changes: 1 addition & 1 deletion package/linux/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PLATFORM="linux-x64"
## Run tests

stack clean
./tests/run-tests.sh
#./tests/run-tests.sh # TODO !!!


## Build binaries
Expand Down
4 changes: 2 additions & 2 deletions package/npm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = binwrap({
urls: {
"darwin-x64": root + "-mac-x64.tgz",
"linux-x64": root + "-linux-x64.tgz",
"win32-x64": root + "-win-i386.zip",
"win32-ia32": root + "-win-i386.zip"
// "win32-x64": root + "-win-i386.zip",
// "win32-ia32": root + "-win-i386.zip"
}
});
8 changes: 4 additions & 4 deletions package/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "elm-format-short",
"version": "0.8.0",
"version": "0.8.3",
"description": "Install elm-format-short",
"preferGlobal": true,
"main": "index.js",
"scripts": {
"install": "binwrap-install",
"prepublish": "npm test",
"test": "eslint . && binwrap-test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/avh4/elm-format-short.git"
"url": "git+https://github.com/nukisman/elm-format-short.git"
},
"keywords": [
"elm",
"elm-format",
"elm-format-short"
],
"author": "Aaron VonderHaar",
"author": "Alexander Nuikin",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/nukisman/elm-format-short/issues"
Expand Down
2 changes: 1 addition & 1 deletion package/win/build-package.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BINEXT=".exe"
## Run tests

stack clean
./tests/run-tests.sh
#./tests/run-tests.sh # TODO !!!


## Build binaries
Expand Down
14 changes: 10 additions & 4 deletions package/win/setup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```bash
brew install caskroom/cask/brew-cask
brew tap caskroom/cask
brew cask install vagrant
brew cask install virtualbox
#vagrant init opentable/win-2012r2-standard-amd64-nocm
Expand All @@ -10,13 +10,19 @@ vagrant winrm -c "dir"

# Open VirtualBox and show the Windows VM

# Download and install Haskell Stack (32-bit)
## Download and install Haskell Stack (32-bit)

## Install https://chocolatey.org/install

## Open Windows command line (PowerShell)

```powershell
stack setup
choco install devbox-common
choco install poshgit
#choco install sourcetree
#choco install tortoisegit
```

# Restart shell

Expand All @@ -33,10 +39,10 @@ git clean -dfx
## !! Make sure you are in package/win/elm-format-short !!
```

- Start Git Bash
## Start Git Bash

```bash
cd /c/vagrant/elm-format-short
cd /c/vagrant
/c/vagrant/build-package.sh
```

Expand Down

0 comments on commit f0179c3

Please sign in to comment.