Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Merge c16988f into 6ae68fc
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphtheninja committed Sep 21, 2018
2 parents 6ae68fc + c16988f commit 742cb2d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 23 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"scripts": {
"rebuild": "node-gyp rebuild --debug --verbose",
"submodule": "git submodule update --recursive --init",
"install": "./scripts/rebuild-all",
"install": "node scripts/rebuild-all.js",
"start-test-server": "./scripts/start-test-server",
"stop-test-server": "./scripts/stop-test-server",
"generate-constants": "./scripts/generate-constants.js",
"test": "standard && npm run dependency-check && nyc node test/index.js",
"test-open": "node test/open.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"coverage-html-report": "rm -rf coverage/ && nyc report --reporter=html && opn coverage/index.html",
"dependency-check": "dependency-check package.json --missing --unused -i dependency-check -i nyc -i opn-cli -i standard -i napi-macros -i coveralls --entry index.js --entry test/index.js --entry scripts/generate-constants.js"
"dependency-check": "dependency-check package.json --missing --unused -i dependency-check -i nyc -i opn-cli -i standard -i napi-macros -i coveralls --entry index.js --entry test/index.js --entry scripts/generate-constants.js --entry scripts/rebuild-all.js"
},
"homepage": "https://github.com/deltachat/deltachat-node",
"repository": {
Expand All @@ -29,7 +29,8 @@
"got": "^9.2.2",
"mkdirp": "^0.5.1",
"napi-macros": "^1.7.0",
"node-gyp-build": "^3.4.0"
"node-gyp-build": "^3.4.0",
"rimraf": "^2.6.2"
},
"devDependencies": {
"coveralls": "^3.0.2",
Expand Down
20 changes: 0 additions & 20 deletions scripts/rebuild-all

This file was deleted.

36 changes: 36 additions & 0 deletions scripts/rebuild-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const path = require('path')
const rimraf = require('rimraf')
const mkdirp = require('mkdirp')
const spawnSync = require('child_process').spawnSync

const coreBuildDir = path.resolve(__dirname, '../deltachat-core/builddir')
console.log(`>> Removing ${coreBuildDir}`)
rimraf.sync(coreBuildDir)

console.log(`>> Creating ${coreBuildDir}`)
mkdirp.sync(coreBuildDir)

console.log('>> meson')
spawnSync('meson', [
'--default-library=static',
'--wrap-mode=forcefallback'
], {
cwd: coreBuildDir,
stdio: 'inherit'
})

console.log('>> ninja')
spawnSync('ninja', [ '-v' ], {
cwd: coreBuildDir,
stdio: 'inherit'
})

const buildDir = path.resolve(__dirname, '../build')
console.log(`>> Removing ${buildDir}`)
rimraf.sync(buildDir)

console.log('>> Rebuilding bindings')
spawnSync('npm', [ 'run', 'rebuild' ], {
cwd: path.resolve(__dirname, '..'),
stdio: 'inherit'
})

0 comments on commit 742cb2d

Please sign in to comment.