diff --git a/buildspec.yaml b/buildspec.yaml index 4aa7b49f4f..53a77826f2 100644 --- a/buildspec.yaml +++ b/buildspec.yaml @@ -12,7 +12,7 @@ phases: build: commands: - yarn build && yarn test - - rm -rf dist/* + - yarn dist-clean - /bin/bash ./scripts/align-version.sh - yarn build post_build: diff --git a/package.json b/package.json index b45c153514..8abfca883b 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "build": "lerna run build --stream --sort --concurrency=1", "bump": "bash scripts/bump.sh", + "dist-clean": "lerna run dist-clean --stream && rm -rf dist", "fetch-dotnet-snk": "bash scripts/fetch-dotnet-snk.sh", "package": "bash scripts/package.sh", "test": "lerna run test --stream", diff --git a/packages/@jsii/dotnet-analyzers/build.sh b/packages/@jsii/dotnet-analyzers/build.sh index 45720cd405..5b698d7491 100644 --- a/packages/@jsii/dotnet-analyzers/build.sh +++ b/packages/@jsii/dotnet-analyzers/build.sh @@ -2,5 +2,3 @@ set -euo pipefail dotnet build --force -c Release ./src/Amazon.JSII.Analyzers - -cp -f ./bin/Release/NuGet/*.nupkg ./bin/Release/NuGet/*.snupkg . diff --git a/packages/@jsii/dotnet-analyzers/package.json b/packages/@jsii/dotnet-analyzers/package.json index ca1abbc949..0c6190373f 100644 --- a/packages/@jsii/dotnet-analyzers/package.json +++ b/packages/@jsii/dotnet-analyzers/package.json @@ -32,9 +32,10 @@ "scripts": { "gen": "/bin/bash ./generate.sh", "build": "npm run gen && tsc --build && /bin/bash ./build.sh", + "dist-clean": "rm -rf dist && dotnet clean -c Release ./src/Amazon.JSII.Analyzers/Amazon.JSII.Analyzers.csproj", "test": "/bin/bash ./test.sh", "test:update": "UPDATE_DIFF=1 npm run test", - "package": "package-dotnet" + "package": "package-dotnet ./src/Amazon.JSII.Analyzers/Amazon.JSII.Analyzers.csproj" }, "devDependencies": { "@types/node": "^10.17.19", diff --git a/packages/@jsii/dotnet-jsonmodel/build.sh b/packages/@jsii/dotnet-jsonmodel/build.sh index c8720f3c39..44aa89cc64 100644 --- a/packages/@jsii/dotnet-jsonmodel/build.sh +++ b/packages/@jsii/dotnet-jsonmodel/build.sh @@ -4,5 +4,3 @@ set -euo pipefail npm run gen dotnet build --force -c Release ./src/Amazon.JSII.JsonModel.sln - -cp -f ./bin/Release/NuGet/*.nupkg ./bin/Release/NuGet/*.snupkg . diff --git a/packages/@jsii/dotnet-jsonmodel/package.json b/packages/@jsii/dotnet-jsonmodel/package.json index 8dcdfd27bf..f371880411 100644 --- a/packages/@jsii/dotnet-jsonmodel/package.json +++ b/packages/@jsii/dotnet-jsonmodel/package.json @@ -30,9 +30,10 @@ "scripts": { "gen": "/bin/bash ./generate.sh", "build": "tsc --build && /bin/bash ./build.sh", + "dist-clean": "rm -rf dist && dotnet clean -c Release ./src/Amazon.JSII.JsonModel/Amazon.JSII.JsonModel.csproj", "test": "/bin/bash ./test.sh", "test:update": "UPDATE_DIFF=1 npm run test", - "package": "package-dotnet" + "package": "package-dotnet ./src/Amazon.JSII.JsonModel/Amazon.JSII.JsonModel.csproj" }, "devDependencies": { "@types/node": "^10.17.19", diff --git a/packages/@jsii/dotnet-runtime/build.sh b/packages/@jsii/dotnet-runtime/build.sh index f53aa2ccc4..dd40c40f55 100644 --- a/packages/@jsii/dotnet-runtime/build.sh +++ b/packages/@jsii/dotnet-runtime/build.sh @@ -10,5 +10,3 @@ rsync -av $(node -p 'require("path").dirname(require.resolve("@jsii/runtime/pack # solution to avoid integration tests from trying to be # built before the calc packages are generated. dotnet build --force -c Release ./src/Amazon.JSII.Runtime - -cp -f ./bin/Release/NuGet/*.nupkg ./bin/Release/NuGet/*.snupkg . diff --git a/packages/@jsii/dotnet-runtime/package.json b/packages/@jsii/dotnet-runtime/package.json index 0e5d403300..ef83af60cf 100644 --- a/packages/@jsii/dotnet-runtime/package.json +++ b/packages/@jsii/dotnet-runtime/package.json @@ -32,9 +32,10 @@ "scripts": { "gen": "/bin/bash ./generate.sh", "build": "npm run gen && tsc --build && /bin/bash ./build.sh", + "dist-clean": "rm -rf dist && dotnet clean -c Release ./src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj", "test": "/bin/bash ./test.sh", "test:update": "UPDATE_DIFF=1 npm run test", - "package": "package-dotnet" + "package": "package-dotnet ./src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj" }, "devDependencies": { "@jsii/dotnet-jsonmodel": "^0.0.0", diff --git a/packages/@jsii/java-runtime/package.json b/packages/@jsii/java-runtime/package.json index 4fd382561c..7ded4bc85d 100644 --- a/packages/@jsii/java-runtime/package.json +++ b/packages/@jsii/java-runtime/package.json @@ -26,6 +26,7 @@ "scripts": { "gen": "/bin/bash ./generate.sh", "build": "tsc --build && npm run gen && cd project && mvn -B deploy -D altDeploymentRepository=local::default::file://${PWD}/../maven-repo", + "dist-clean": "rm -rf dist maven-repo && cd project && mvn -B clean", "test": "echo 'Tests are run as part of the build target'", "test:update": "UPDATE_DIFF=1 npm run test", "package": "package-java" diff --git a/packages/@jsii/python-runtime/.gitignore b/packages/@jsii/python-runtime/.gitignore index 3696b9726d..1580fafb23 100644 --- a/packages/@jsii/python-runtime/.gitignore +++ b/packages/@jsii/python-runtime/.gitignore @@ -12,4 +12,6 @@ __pycache__ .mypy_cache .pytest_cache +build + README.md diff --git a/packages/@jsii/python-runtime/package.json b/packages/@jsii/python-runtime/package.json index 53995fa6c5..63acea37b2 100644 --- a/packages/@jsii/python-runtime/package.json +++ b/packages/@jsii/python-runtime/package.json @@ -24,7 +24,8 @@ "scripts": { "generate": "python3 bin/generate", "deps": "python3 -m venv .env && .env/bin/pip install pip~=20.0.2 setuptools~=46.1.3 wheel~=0.34.2 && .env/bin/pip install -r requirements.txt", - "build": "cp ../../../README.md . && rm -f jsii-*.whl && npm run generate && npm run deps && .env/bin/python setup.py sdist -d . bdist_wheel -d . && rm -rf build", + "dist-clean": "rm -rf dist", + "build": "cp ../../../README.md . && rm -f jsii-*.whl && npm run generate && npm run deps", "package": "package-python", "test": ".env/bin/python bin/generate-calc && .env/bin/py.test -v --mypy", "test:update": "UPDATE_DIFF=1 .env/bin/python bin/generate-calc && .env/bin/py.test -v --mypy" diff --git a/packages/@jsii/ruby-runtime/package.json b/packages/@jsii/ruby-runtime/package.json index 3018944246..9732d9a028 100644 --- a/packages/@jsii/ruby-runtime/package.json +++ b/packages/@jsii/ruby-runtime/package.json @@ -26,8 +26,9 @@ "scripts": { "gen": "/bin/bash generate.sh", "deps": "cd project && bundle install --path vendor/bundle --binstubs vendor/bin", + "dist-clean": "rm -rf dist", "lint": "cd project && vendor/bin/rubocop", - "build": "npm run gen && npm run deps && npm run lint && gem build project/*.gemspec", + "build": "npm run gen && npm run deps && npm run lint", "test": "cd project && ruby test/suite.rb", "test:update": "UPDATE_DIFF=1 npm run test", "package": "package-ruby" diff --git a/tools/jsii-build-tools/bin/package-dotnet b/tools/jsii-build-tools/bin/package-dotnet index 139a3acebe..50f2c18b5d 100755 --- a/tools/jsii-build-tools/bin/package-dotnet +++ b/tools/jsii-build-tools/bin/package-dotnet @@ -1,5 +1,7 @@ #!/bin/bash set -euo pipefail -rm -fr dist/dotnet + mkdir -p dist/dotnet -cp *.nupkg *.snupkg dist/dotnet + +dotnet build --force -c Release $1 +dotnet pack --include-symbols --include-source --output dist/dotnet -c Release $1 diff --git a/tools/jsii-build-tools/bin/package-java b/tools/jsii-build-tools/bin/package-java index dd150f170e..d3fd6945ca 100755 --- a/tools/jsii-build-tools/bin/package-java +++ b/tools/jsii-build-tools/bin/package-java @@ -1,6 +1,7 @@ #!/bin/bash set -euo pipefail -rm -fr dist/java + mkdir -p dist/java + rsync -av maven-repo/ dist/java/ diff --git a/tools/jsii-build-tools/bin/package-python b/tools/jsii-build-tools/bin/package-python index 300e9e1d36..281614d4f0 100755 --- a/tools/jsii-build-tools/bin/package-python +++ b/tools/jsii-build-tools/bin/package-python @@ -1,7 +1,6 @@ #!/bin/bash set -euo pipefail -rm -rf dist/python mkdir -p dist/python -cp *.whl dist/python -cp *.tar.gz dist/python + +.env/bin/python setup.py sdist -d dist/python bdist_wheel -d dist/python diff --git a/tools/jsii-build-tools/bin/package-ruby b/tools/jsii-build-tools/bin/package-ruby index a661137e00..a217193a45 100755 --- a/tools/jsii-build-tools/bin/package-ruby +++ b/tools/jsii-build-tools/bin/package-ruby @@ -1,5 +1,7 @@ #!/bin/bash set -euo pipefail -rm -fr dist/ruby + mkdir -p dist/ruby -cp *.gem dist/ruby + +gem build project/*.gemspec +mv *.gem dist/ruby