diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..b7e0fb8 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,52 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Build Raw", + "type": "shell", + "command": "python ./build.py --nominify --copytracker", + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "shared", + "echo": true, + "focus": false, + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "Build Minified", + "type": "shell", + "command": "python ./build.py --copytracker", + "group": "build", + "presentation": { + "reveal": "always", + "panel": "shared", + "echo": true, + "focus": false, + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "Build Website", + "type": "shell", + "command": "python ./build.py --website", + "group": "build", + "presentation": { + "reveal": "always", + "panel": "shared", + "echo": true, + "focus": false, + "showReuseMessage": false + }, + "problemMatcher": [] + } + ] +} diff --git a/build.py b/build.py index 6e1ca8b..2f6c9fa 100644 --- a/build.py +++ b/build.py @@ -15,10 +15,11 @@ EXEC_YUI = "java -jar lib/yuicompressor-2.4.8.jar --charset utf-8 --line-break 1 USE_UGLIFYJS = "--nominify" not in sys.argv USE_JAVA = "--nominify" not in sys.argv BUILD_WEBSITE = "--website" in sys.argv +CLIPBOARD_TRACKER = "--copytracker" in sys.argv WORKING_DIR = os.getcwd() - + if USE_JAVA and shutil.which("java") is None: USE_JAVA = False print("Could not find 'java', CSS minification will be disabled") @@ -33,7 +34,7 @@ else: USE_UGLIFYJS = False print("Could not find 'uglifyjs', JS minification will be disabled") - + with open("reserve.txt", "r") as reserved: RESERVED_PROPS = ",".join(line.strip() for line in reserved.readlines()) @@ -159,3 +160,12 @@ build_renderer() if BUILD_WEBSITE: print("Building website...") build_website() + +if CLIPBOARD_TRACKER: + if os.name == "nt": + print("Copying to clipboard...") + os.system("clip < bld/track.js") + else: + print("Clipboard is only supported on Windows") + +print("Done")