Skip to content

Commit

Permalink
Update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis-Averin committed Jul 2, 2023
1 parent 32d6c0c commit 04aa3cd
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 55 deletions.
4 changes: 2 additions & 2 deletions codegen/Templates/csharp/README.mustache
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Aspose.BarCode Cloud SDK for .NET

[![License](https://img.shields.io/github/license/aspose-barcode-cloud/aspose-barcode-cloud-dotnet)](LICENSE)
[![.NET Core Linux](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/actions/workflows/dotnet-core.yml/badge.svg)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/actions/workflows/dotnet-core.yml)
[![.NET Framework Windows](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/actions/workflows/net-framework.yml/badge.svg)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/actions/workflows/net-framework.yml)
[![.NET Core Linux](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/actions/workflows/dotnet-core.yml/badge.svg?branch=main)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/actions/workflows/dotnet-core.yml)
[![.NET Framework Windows](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/actions/workflows/net-framework.yml/badge.svg?branch=main)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet/actions/workflows/net-framework.yml)
[![Nuget](https://img.shields.io/nuget/v/Aspose.BarCode-Cloud)](https://www.nuget.org/packages/Aspose.BarCode-Cloud/)

- API version: {{appVersion}}
Expand Down
2 changes: 2 additions & 0 deletions codegen/Templates/dart/README.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Aspose.BarCode Cloud SDK for Dart

[![Dart test](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dart/actions/workflows/dart-compile.yml/badge.svg?branch=main)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dart/actions/workflows/dart-compile.yml)

- API version: {{appVersion}}
- SDK version: {{pubVersion}}

Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/go/README.mustache
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Aspose.BarCode Cloud SDK for Go

[![License](https://img.shields.io/github/license/aspose-barcode-cloud/aspose-barcode-cloud-go)](LICENSE)
[![Go](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/actions/workflows/go.yml/badge.svg)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/actions/workflows/go.yml)
[![Go](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/actions/workflows/go.yml)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/aspose-barcode-cloud/aspose-barcode-cloud-go?label=module&sort=semver)](https://pkg.go.dev/github.com/aspose-barcode-cloud/aspose-barcode-cloud-go)

- API version: {{appVersion}}
Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/java/README.mustache
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# {{artifactDescription}}

[![License](https://img.shields.io/github/license/aspose-barcode-cloud/aspose-barcode-cloud-java)](LICENSE)
[![Java CI with Maven](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-java/actions/workflows/maven.yml/badge.svg)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-java/actions/workflows/maven.yml)
[![Java CI with Maven](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-java/actions/workflows/maven.yml/badge.svg?branch=main)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-java/actions/workflows/maven.yml)
[![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Freleases.aspose.cloud%2Fjava%2Frepo%2Fcom%2Faspose%2Faspose-barcode-cloud%2Fmaven-metadata.xml)](https://releases.aspose.cloud/java/repo/com/aspose/aspose-barcode-cloud/)

- API version: {{appVersion}}
Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/nodejs/docs/tsconfig.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Aspose.BarCode Cloud SDK for Node.js

[![License](https://img.shields.io/github/license/aspose-barcode-cloud/aspose-barcode-cloud-node)](LICENSE)
[![Node.js CI](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-node/actions/workflows/node.js.yml/badge.svg)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-node/actions/workflows/node.js.yml)
[![Node.js CI](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-node/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-node/actions/workflows/node.js.yml)
[![npm](https://img.shields.io/npm/v/aspose-barcode-cloud-node)](https://www.npmjs.com/package/aspose-barcode-cloud-node)

+ API version: {{appVersion}}
Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/python/README.mustache
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Aspose.BarCode Cloud SDK for Python

[![License](https://img.shields.io/github/license/aspose-barcode-cloud/aspose-barcode-cloud-python)](LICENSE)
[![Python package](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python/actions/workflows/python-package.yml/badge.svg)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python/actions/workflows/python-package.yml)
[![Python package](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python/actions/workflows/python-package.yml/badge.svg?branch=main)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python/actions/workflows/python-package.yml)
[![PyPI](https://img.shields.io/pypi/v/aspose-barcode-cloud)](https://pypi.org/project/aspose-barcode-cloud/)

- API version: {{appVersion}}
Expand Down
4 changes: 3 additions & 1 deletion codegen/generate-android.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ exampleDir="$targetDir/app/src/main/java/com/aspose/barcode/cloud/demo_app"
rm -rf "${exampleDir:?}/*"
mkdir -p "$exampleDir" || true
cp "$tempDir/src/main/java/com/aspose/barcode/cloud/demo_app/ApiException.java" "$exampleDir/MainActivity.kt"
cp Templates/LICENSE "$targetDir/"

cp Templates/LICENSE "$targetDir/"

rm -rf $tempDir
20 changes: 11 additions & 9 deletions codegen/generate-dart.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,33 @@ fi
java -jar Tools/swagger-codegen-cli.jar generate -i "$specSource" -l dart -t Templates/dart -o $tempDir -c config-dart.json


cp Templates/LICENSE "$targetDir/"
mv "$tempDir/README.md" "$targetDir"
mv "$tempDir/.gitignore" "$targetDir/"
mv "$tempDir/pubspec.yaml" "$targetDir/"
mv "$tempDir/README.md" "$targetDir"
mv "$tempDir/.gitignore" "$targetDir/"
mv "$tempDir/pubspec.yaml" "$targetDir/"


rm -rf "${targetDir:?}/lib/*" || mkdir -p "$targetDir/lib/"
mv $tempDir/lib/*.dart $targetDir/lib/

mkdir -p "$targetDir/lib/model/"
mv $tempDir/lib/model/*.dart $targetDir/lib/model/
mv $tempDir/lib/model/*.dart $targetDir/lib/model/

mkdir -p "$targetDir/lib/api/"
mv $tempDir/lib/api/*.dart $targetDir/lib/api/

mkdir -p "$targetDir/lib/auth/"
mv "$tempDir/lib/auth/authentication.dart" "$targetDir/lib/auth/"
mv "$tempDir/lib/auth/oauth.dart" "$targetDir/lib/auth/"
mv "$tempDir/lib/auth/authentication.dart" "$targetDir/lib/auth/"
mv "$tempDir/lib/auth/oauth.dart" "$targetDir/lib/auth/"

rm -rf "$targetDir/doc/"
mkdir -p "$targetDir/doc/api/"

mv $tempDir/docs/*Api.md $targetDir/doc/api/
mv $tempDir/docs/*Api.md $targetDir/doc/api/
mkdir -p "$targetDir/doc/models/"
mv $tempDir/docs/*.md $targetDir/doc/models/
mv $tempDir/docs/*.md $targetDir/doc/models/

cp Templates/LICENSE "$targetDir/"
cp ../scripts/check-badges.bash "$targetDir/scripts/"

# Cleanup
rm -rf $tempDir
Expand Down
21 changes: 11 additions & 10 deletions codegen/generate-dotnet.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ python Tools/split-cs-file.py $tempDir/src/Aspose.BarCode.Cloud.Sdk/Api/FileApi.
python Tools/split-cs-file.py $tempDir/src/Aspose.BarCode.Cloud.Sdk/Api/FolderApi.cs $tempDir/src/Aspose.BarCode.Cloud.Sdk/Model/Requests/
python Tools/split-cs-file.py $tempDir/src/Aspose.BarCode.Cloud.Sdk/Api/StorageApi.cs $tempDir/src/Aspose.BarCode.Cloud.Sdk/Model/Requests/

cp Templates/LICENSE "$targetDir/"
cp Templates/LICENSE "$targetDir/src/LICENSE.txt"
cp Templates/LICENSE "$targetDir/"
cp Templates/LICENSE "$targetDir/src/LICENSE.txt"
cp ../scripts/check-badges.bash "$targetDir/scripts/"

rm -rf "$targetDir/src/Model/"
mv "$tempDir/src/Aspose.BarCode.Cloud.Sdk/Model" "$targetDir/src"
mv "$tempDir/src/Aspose.BarCode.Cloud.Sdk/Model" "$targetDir/src"

rm -rf $targetDir/src/Api/*Api.cs
mv $tempDir/src/Aspose.BarCode.Cloud.Sdk/Api/*.cs $targetDir/src/Api/
mv $tempDir/src/Aspose.BarCode.Cloud.Sdk/Client/Configuration.cs $targetDir/src/Api/
mv $tempDir/src/Aspose.BarCode.Cloud.Sdk/Api/*.cs $targetDir/src/Api/
mv $tempDir/src/Aspose.BarCode.Cloud.Sdk/Client/Configuration.cs $targetDir/src/Api/

rm -rf "$targetDir/docs"
mv "$tempDir/docs" "$targetDir/"
mv "$tempDir/docs" "$targetDir/"

mv "$tempDir/README.md" "$targetDir/README.template"
mv "$tempDir/src/Aspose.BarCode.Cloud.Sdk/Aspose.BarCode.Cloud.Sdk.csproj" "$targetDir/src/Aspose.BarCode.Cloud.Sdk.csproj"
cp "$tempDir/src/Aspose.BarCode.Cloud.Sdk.Test/Aspose.BarCode.Cloud.Sdk.Test.csproj" "$targetDir/examples/GenerateQR/GenerateQR.csproj"
cp "$tempDir/src/Aspose.BarCode.Cloud.Sdk.Test/Aspose.BarCode.Cloud.Sdk.Test.csproj" "$targetDir/examples/ReadQR/ReadQR.csproj"
mv "$tempDir/README.md" "$targetDir/README.template"
mv "$tempDir/src/Aspose.BarCode.Cloud.Sdk/Aspose.BarCode.Cloud.Sdk.csproj" "$targetDir/src/Aspose.BarCode.Cloud.Sdk.csproj"
cp "$tempDir/src/Aspose.BarCode.Cloud.Sdk.Test/Aspose.BarCode.Cloud.Sdk.Test.csproj" "$targetDir/examples/GenerateQR/GenerateQR.csproj"
cp "$tempDir/src/Aspose.BarCode.Cloud.Sdk.Test/Aspose.BarCode.Cloud.Sdk.Test.csproj" "$targetDir/examples/ReadQR/ReadQR.csproj"


rm -rf $tempDir
Expand Down
13 changes: 7 additions & 6 deletions codegen/generate-go.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ java -jar Tools/swagger-codegen-cli.jar generate -i "$specSource" -l go -t Templ
rm -rf "$targetDir/barcode"

mkdir -p "$targetDir/barcode/jwt"
mv "$tempDir/response.go" "$targetDir/barcode/jwt/jwt.go"
mv "$tempDir/response.go" "$targetDir/barcode/jwt/jwt.go"

mv $tempDir/*.go $targetDir/barcode/
mv $tempDir/*.go $targetDir/barcode/

rm -rf "$targetDir/docs/*"
mv $tempDir/docs/* $targetDir/docs/
mv "$tempDir/README.md" "$targetDir/README.md"
cp Templates/LICENSE "$targetDir/"
mv $tempDir/docs/* $targetDir/docs/
mv "$tempDir/README.md" "$targetDir/README.md"
cp Templates/LICENSE "$targetDir/"
cp ../scripts/check-badges.bash "$targetDir/scripts/"

rm -rf $tempDir
rm -rf $tempDir

pushd "$targetDir" && make after-gen && popd >/dev/null
4 changes: 2 additions & 2 deletions codegen/generate-java.bash
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ mv $tempDir/docs/* $targetDir/docs

mv $tempDir/README.md $targetDir
mv $tempDir/pom.xml $targetDir
cp Templates/LICENSE $targetDir

cp Templates/LICENSE $targetDir
cp ../scripts/check-badges.bash "$targetDir/scripts/"

rm -rf $tempDir

Expand Down
16 changes: 8 additions & 8 deletions codegen/generate-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ java -jar Tools/swagger-codegen-cli.jar generate -i "$specSource" -l typescript-
# java -DdebugOperations -jar Tools/swagger-codegen-cli.jar generate -i "$specSource" -l typescript-node -t Templates/nodejs -o $tempDir -c config.json > debugOperations.ts.json
# java -DdebugSupportingFiles -jar Tools/swagger-codegen-cli.jar generate -i "$specSource" -l typescript-node -t Templates/nodejs -o $tempDir -c config.json 2> debugSupportingFiles.ts.txt

mv "$tempDir/api.ts" "$targetDir/src/"
mv "$tempDir/package.json" "$targetDir/"
mv "$tempDir/git_push.sh" "$targetDir/src/models.ts"
mv "$tempDir/api.ts" "$targetDir/src/"
mv "$tempDir/package.json" "$targetDir/"
mv "$tempDir/git_push.sh" "$targetDir/src/models.ts"

# Use typescript-node one more time because typescript-node does not generate docs
java -jar Tools/swagger-codegen-cli.jar generate -i "$specSource" -l typescript-node -t Templates/nodejs/docs -o $tempDir/docs -c config.json
# java -DdebugModels -jar Tools/swagger-codegen-cli.jar generate -i "$specSource" -l typescript-node -t Templates/nodejs/docs -o $tempDir/docs -c config.json > debugModels.docs.json
# java -DdebugOperations -jar Tools/swagger-codegen-cli.jar generate -i "$specSource" -l typescript-node -t Templates/nodejs/docs -o $tempDir/docs -c config.json > debugOperations.docs.json

mv "$tempDir/docs/api.ts" "$targetDir/docs/index.md"
mv "$tempDir/docs/git_push.sh" "$targetDir/docs/models.md"
mv "$tempDir/docs/tsconfig.json" "$targetDir/README.md"
cp Templates/LICENSE "$targetDir/"

mv "$tempDir/docs/api.ts" "$targetDir/docs/index.md"
mv "$tempDir/docs/git_push.sh" "$targetDir/docs/models.md"
mv "$tempDir/docs/tsconfig.json" "$targetDir/README.md"
cp Templates/LICENSE "$targetDir/"
cp ../scripts/check-badges.bash "$targetDir/scripts/"

rm -rf $tempDir

Expand Down
3 changes: 2 additions & 1 deletion codegen/generate-php.bash
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ rm -rf "${targetDir}/docs/"*
mv "${tempDir}/SwaggerClient-php/docs/"* "${targetDir}/docs"

mv "${tempDir}/SwaggerClient-php/README.md" "${targetDir}/"
cp "Templates/LICENSE" "${targetDir}/"
cp Templates/LICENSE "${targetDir}/"
cp ../scripts/check-badges.bash "$targetDir/scripts/"


rm -rf "${tempDir}"
Expand Down
3 changes: 2 additions & 1 deletion codegen/generate-python.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ cp "$tempDir/requirements.txt" "$targetDir/requirements.txt"
cp "$tempDir/test-requirements.txt" "$targetDir/test-requirements.txt"
cp "$tempDir/tox.ini" "$targetDir/tox.ini"
cp "$tempDir/README.md" "$targetDir/README.md"
cp Templates/LICENSE "$targetDir/"

cp Templates/LICENSE "$targetDir/"
cp ../scripts/check-badges.bash "$targetDir/scripts/"

rm -rf $tempDir

Expand Down
25 changes: 25 additions & 0 deletions scripts/check-badges.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -euo pipefail

readme_file=$1

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

pushd "${SCRIPT_DIR}/.." >/dev/null

(grep -oP '[^/]+\.yml(?=/badge.svg)' "${readme_file}" || (>&2 echo "No badges in ${readme_file}" ; exit 1)) | while read -r workflow_file; do
path_to_workflow=".github/workflows/${workflow_file}"
if [ ! -e "${path_to_workflow}" ]
then
>&2 echo "Error, workflow does not exist \"${path_to_workflow}\""
exit 1
fi
done

(grep -oP '[^/]+\.yml/badge.svg(?!\?branch=main)' "${readme_file}" || echo ) | while read -r badge_without_branch; do
if [ -z "${badge_without_branch}" ]; then continue; fi
>&2 echo "Badge without branch \"${badge_without_branch}\""
exit 1
done

popd >/dev/null
4 changes: 4 additions & 0 deletions scripts/sync_submodules.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -euo pipefail

git submodule update --init --recursive
4 changes: 0 additions & 4 deletions scripts/update_submodules.bash

This file was deleted.

2 changes: 1 addition & 1 deletion submodules/dart
2 changes: 1 addition & 1 deletion submodules/dotnet
2 changes: 1 addition & 1 deletion submodules/go
2 changes: 1 addition & 1 deletion submodules/java
2 changes: 1 addition & 1 deletion submodules/node
2 changes: 1 addition & 1 deletion submodules/php
2 changes: 1 addition & 1 deletion submodules/python

0 comments on commit 04aa3cd

Please sign in to comment.