Add publish script to package the whole project.

This commit is contained in:
Junyi Yi 2018-04-16 18:53:58 -07:00
Родитель 1171ff63da
Коммит a25d3d0d6d
5 изменённых файлов: 28 добавлений и 3 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -293,3 +293,7 @@ __pycache__/
# AutoRest generated folder
samples/**/generated/
# NPM Package
*.tgz
*.tar

Просмотреть файл

@ -42,6 +42,14 @@ The `clean` task clears all intermediate files as well as all the binary files.
$ npm run clean
```
### Package
The `package` task generates a ready-to-publish *.tgz file which includes all the binaries. This task also forces to rebuild the whole project using `Release` configuration.
```shell
$ npm run package
```
## Working with IDE
### Visual Studio

Просмотреть файл

@ -1,6 +1,7 @@
const path = require('path');
const gulp = require('gulp');
const clean = require('gulp-clean');
const {
clean: dotnet_clean,
build: dotnet_build
@ -9,7 +10,9 @@ const shrun = require('gulp-run');
gulp.task('clean', () => {
return gulp.src('*.sln', { read: false })
.pipe(dotnet_clean());
.pipe(dotnet_clean())
.pipe(gulp.src(['*.tgz', '*.tar']))
.pipe(clean({ force: true }));
});
gulp.task('build:debug', () => {
@ -22,6 +25,11 @@ gulp.task('build', ['clean'], () => {
.pipe(dotnet_build({ configuration: 'Release' }));
});
gulp.task('publish', ['build'], () => {
return gulp.src('.', { read: false })
.pipe(shrun('npm pack'));
});
function getAutoRestCommand(config) {
const plugin = path.resolve('.').replace(/\\/g, '\\\\');

Просмотреть файл

@ -7,7 +7,8 @@
"clean": "gulp clean",
"build": "gulp build",
"build:debug": "gulp build:debug",
"samples:hdinsight": "gulp run:hdinsight"
"samples:hdinsight": "gulp run:hdinsight",
"package": "gulp publish"
},
"repository": {
"type": "git",
@ -25,11 +26,15 @@
"url": "https://github.com/Azure/autorest.terraform-provider/issues"
},
"homepage": "https://github.com/Azure/autorest.terraform-provider#readme",
"files": [
"bin/"
],
"devDependencies": {
"@microsoft.azure/autorest.modeler": "^2.3.47",
"autorest": "^2.0.4245",
"dotnet-sdk-2.0.0": "^1.4.4",
"gulp": "^3.9.1",
"gulp-clean": "^0.4.0",
"gulp-cli": "^2.0.1",
"gulp-dotnet-cli": "^1.1.0",
"gulp-run": "^1.7.1"

Просмотреть файл

@ -30,7 +30,7 @@ namespace AutoRest.Terraform
protected new TemplateIndentation Indentation { get; set; }
protected CodeNamerTf CodeNamer => Singleton<CodeNamerTf>.Instance;
private protected V OtherModel<V>()
protected V OtherModel<V>()
where V : ITfProviderGenerator
=> Singleton<V>.Instance;