Skip to content

Commit

Permalink
Replace makefile dependency with bash script
Browse files Browse the repository at this point in the history
Switched to a bash script for build.  Not great but make is
not convenient on windows machines.

Bash is everywhere and our commands are not complex.

Fixes #638
  • Loading branch information
bitwiseman committed Jan 20, 2016
1 parent 603dc44 commit db89721
Show file tree
Hide file tree
Showing 13 changed files with 366 additions and 294 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ python:
- "3.2"
- "3.3"
- "3.4"
- "3.5"

node_js:
- "0.8"
- "0.10"



script: "make"
script: "./build ci"
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
## Report issues
If you find a bug, please report it, including environment and examples of current behavior and what you believe to be the correct behavior. The clearer your description and information, the more likely it is someone will be able to make progress on it.

## Build and test
If you run `./build full` from the root folder locally, build and tests will run and should all pass.

## Fix issues
Pull requests with fixes are totally welcome. Familiarize yourself with the folder structure and code style before you dive in. Where possible fixes should include tests to prevent future regressions in functionality. Also, if they apply and you have the ability, make fixes to both python and javascript implementations.

We use travis-ci.org to run build and test passes. If you run `make` from the root folder locally, tests will run and should all pass before your pull request will be accepted.
We use travis-ci.org to run build and test passes. If you run `./build full` from the root folder locally, tests will run and must all pass. The build may generate updated test files - commit any changes reported by `git status` after the build completes. Then create pull request.


# Folders
Expand Down Expand Up @@ -37,7 +40,7 @@ This project has been around for a while. While some parts have improved signif
into disrepair and were mothballed.

### PHP
There is a out-of-date version of the beautifier available on branch `attic-php`. If you're interested
There is an out-of-date version of the beautifier available on branch `attic-php`. If you're interested
in using it feel free. If you plan to enhance it, please consider joining this project, and updating this
version to match current functionality.

Expand Down
74 changes: 0 additions & 74 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Configuration sources provided earlier in this stack will override later ones.

You might notice that the CLI options and defaults hash aren't 100% correlated. Historically, the Python and JS APIs have not been 100% identical. For example, `space_before_conditional` is currently JS-only, and not addressable from the CLI script. There are a few other additional cases keeping us from 100% API-compatibility. Patches welcome!

## Directives to Ignore or Preserve sections (Javascript only)
## Directives to Ignore or Preserve sections (Javascript only)

Beautifier for supports directives in comments inside the file.
This allows you to tell the beautifier to preserve the formtatting of or completely ignore part of a file.
Expand Down
22 changes: 10 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ deploy: off

# Test against this version of Node.js
environment:
nodejs_version: "0.12"
global:
nodejs_version: "0.12"

matrix:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: "32"

# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
# install modules
- npm install
- python -m pip install -e ./python
- echo "Generating tests"
- node test/generate-tests.js
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- pip --version

# Post-install test scripts.
test_script:
Expand All @@ -26,12 +29,7 @@ test_script:
- npm --version
- python --version
# run tests
- echo "Testing javascript implementation"
- npm test
- echo "Testing python implementation"
- bash -c "cd python && ./jsbeautifier/tests/shell-smoke-test.sh"
- echo "Verifying git status clean"
- bash -c "./test/git-status-clear.sh"
- bash -c "./build ci"

# Don't actually build.
build: off
5 changes: 5 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

REL_SCRIPT_DIR="`dirname \"$0\"`"
SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
$SCRIPT_DIR/tools/build.sh $*
2 changes: 1 addition & 1 deletion js/test/shell-smoke-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

REL_SCRIPT_DIR="`dirname \"$0\"`"
SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"test": "js/test"
},
"scripts": {
"test": "bash -c ./js/test/shell-smoke-test.sh",
"update-codemirror": "npm install codemirror && rm -rf ./web/third-party/codemirror/* && cp ./node_modules/codemirror/LICENSE ./web/third-party/codemirror/ && cp ./node_modules/codemirror/README.md ./web/third-party/codemirror/ && cp -r ./node_modules/codemirror/lib ./web/third-party/codemirror/ && mkdir -p ./web/third-party/codemirror/mode && cp -r ./node_modules/codemirror/mode/javascript ./web/third-party/codemirror/mode/ && git add -Av ./web/third-party/codemirror"
},
"bugs": "https://github.com/beautify-web/js-beautify/issues",
"homepage": "http://jsbeautifier.org/",
Expand Down
Loading

0 comments on commit db89721

Please sign in to comment.