From 7d1ccdaa052c62d0db9050c479b443e100ef8a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sat, 18 Nov 2017 18:41:24 +0100 Subject: [PATCH] Add release script. --- release/.gitignore | 3 +++ release/make-release.js | 26 ++++++++++++++++++++++++++ release/package.json | 17 +++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 release/.gitignore create mode 100755 release/make-release.js create mode 100644 release/package.json diff --git a/release/.gitignore b/release/.gitignore new file mode 100644 index 0000000..806f37b --- /dev/null +++ b/release/.gitignore @@ -0,0 +1,3 @@ +node_modules +package-lock.json +uhk-bootloader-*.hex diff --git a/release/make-release.js b/release/make-release.js new file mode 100755 index 0000000..681017e --- /dev/null +++ b/release/make-release.js @@ -0,0 +1,26 @@ +#!/usr/bin/env node +const fs = require('fs'); +require('shelljs/global'); + +config.fatal = true; +config.verbose = true; + +const bootloaderHex = `${__dirname}/../targets/MK22F51212/kds/freedom_bootloader/release/freedom_bootloader.hex`; +const targetConfigH = `${__dirname}/../targets/MK22F51212/src/target_config.h` +const targetConfigHContent = fs.readFileSync(targetConfigH, 'utf8'); + +const majorNumber = targetConfigHContent.match(/kTarget_Version_Major = ([0-9]+)/)[1]; +const minorNumber = targetConfigHContent.match(/kTarget_Version_Minor = ([0-9]+)/)[1]; +const patchNumber = targetConfigHContent.match(/kTarget_Version_Bugfix = ([0-9]+)/)[1]; + +rm('-f', bootloaderHex); + +exec(`/opt/Freescale/KDS_v3/eclipse/kinetis-design-studio \ +--launcher.suppressErrors \ +-noSplash \ +-application org.eclipse.cdt.managedbuilder.core.headlessbuild \ +-import ${__dirname}/../targets/MK22F51212/kds/freedom_bootloader \ +-cleanBuild freedom_bootloader` +); + +cp(bootloaderHex, `uhk-bootloader-${majorNumber}.${minorNumber}.${patchNumber}.hex`); diff --git a/release/package.json b/release/package.json new file mode 100644 index 0000000..0ab7aff --- /dev/null +++ b/release/package.json @@ -0,0 +1,17 @@ +{ + "name": "uhk-bootloader", + "homepage": "https://UltimateHackingKeyboard.com", + "description": "The bootloader of the Ultimate Hacking Keyboard", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/UltimateHackingKeyboard/bootloader.git" + }, + "author": "Ultimate Gadget Laboratories", + "license": "GPL-3.0", + "bugs": { + "url": "https://github.com/UltimateHackingKeyboard/bootloader/issues" + }, + "dependencies": { + "shelljs": "^0.7.8" + } +}