-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cli] basic --help/ command structure + basic build implementation
(build will pick up specific files)
- Loading branch information
1 parent
bef0493
commit 6c4cb9c
Showing
4 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const gulp = require("gulp"); | ||
|
||
gulp.task("build:model", function (done) { | ||
const asc = require("assemblyscript/bin/asc"); | ||
asc.main([ | ||
"model.ts", | ||
"--baseDir", "./out", | ||
"--nearFile", "../out/model.near.ts", | ||
"--measure" | ||
], done); | ||
}); | ||
|
||
gulp.task("build:bindings", function (done) { | ||
console.log('bb1') | ||
const asc = require('assemblyscript/bin/asc'); | ||
asc.main([ | ||
"main.ts", | ||
"--baseDir", "./out", | ||
"--binaryFile", "../out/main.wasm", | ||
"--nearFile", "../out/main.near.ts", | ||
"--measure" | ||
], done); | ||
}); | ||
|
||
gulp.task("build:all", gulp.series('build:model', 'build:bindings', function (done) { | ||
done(); | ||
})); | ||
|
||
gulp.task('copyfiles', function(done) { | ||
return gulp.src('./assembly/**/*') | ||
.pipe(gulp.dest('./out/')); | ||
}); | ||
|
||
gulp.task('build', gulp.series('copyfiles', 'build:all', function(done) { | ||
done(); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env node | ||
|
||
const commandLineArgs = require('command-line-args'); | ||
const nearLib = require('nearlib'); | ||
const gulp = require('gulp'); | ||
const gulpfile = require('./gulpfile') // import the gulp file | ||
|
||
require('yargs') // eslint-disable-line | ||
.command('build', 'build your smart contract', (yargs) => { | ||
|
||
}, (argv) => { | ||
if (argv.verbose) console.info(`build contract on :${argv.port}`) | ||
if (gulp.task('build')) { | ||
const result = gulp.task('build')(); | ||
} | ||
}) | ||
.command('deploy', 'deploy your smart contract', (yargs) => { | ||
yargs | ||
.positional('contract_name', { | ||
describe: 'Name of the contract to deploy', | ||
default: 'default' | ||
}) | ||
}, (argv) => { | ||
if (argv.verbose) console.info(`deploy contract`) | ||
console.log('NOT IMPLEMENTED YET') | ||
}) | ||
.argv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters