Permalink
Browse files

Replace makefile dependency with bash script

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...
1 parent 603dc44 commit db897211fa1152c42cf6bb4b0b641e5c6eccfdfc @bitwiseman bitwiseman committed Jan 20, 2016
View
@@ -4,10 +4,11 @@ python:
- "3.2"
- "3.3"
- "3.4"
+ - "3.5"
node_js:
- - "0.8"
+ - "0.10"
-script: "make"
+script: "./build ci"
View
@@ -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
@@ -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.
View
@@ -1,74 +0,0 @@
-
-define AVAILABLE_ACTIONS
-
-build: do static checking and build of js
-buildp: do static checking and build of python
-buildj: do static checking and build of javascript
-test: test both implementations, js and python
-testp: test python implementation
-testj: test javascript implementation
-
-endef
-export AVAILABLE_ACTIONS
-
-
-.SILENT:
-all: build test status
-
-help:
- echo "$$AVAILABLE_ACTIONS"
-
-build: buildj buildp
-
-buildj:
- echo Building javascript... ;\
- npm install ;\
-
-buildp:
- echo Building python... ;\
- pip install -e ./python
-
-testp:
- echo Testing python implementation...
- node test/generate-tests.js || exit 1;\
- cd python ;\
- python --version ;\
- ./jsbeautifier/tests/shell-smoke-test.sh
-
-testj:
- echo Testing javascript implementation...
- node test/generate-tests.js || exit 1;\
- node --version; \
- npm test
-
-
-edit:
- vim \
- js/lib/beautify.js python/jsbeautifier/__init__.py \
- js/test/beautify-tests.js python/jsbeautifier/tests/testjsbeautifier.py
-
-gedit:
- gvim \
- js/lib/beautify.js \
- js/test/beautify-tests.js \
- python/jsbeautifier/__init__.py \
- python/jsbeautifier/tests/testjsbeautifier.py &
-
-tests: testj testp
-
-test: testj testp
-
-status:
- test/git-status-clear.sh || exit 1
-
-
-gh:
- git push origin master &&\
- cd gh-pages &&\
- git fetch &&\
- git checkout gh-pages &&\
- git reset --hard origin/gh-pages &&\
- git merge origin/master &&\
- git push origin gh-pages
-
-.PHONY: testp testj all edit tests test
View
@@ -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.
View
@@ -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:
@@ -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
View
@@ -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 $*
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
REL_SCRIPT_DIR="`dirname \"$0\"`"
SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
View
@@ -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/",
Oops, something went wrong.

0 comments on commit db89721

Please sign in to comment.