-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Nuvindu/initial-version
Add the initial implementation of the XSD tool
- Loading branch information
Showing
108 changed files
with
30,598 additions
and
0 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,2 @@ | ||
# Ensure all Java files use LF. | ||
*.java eol=lf |
Validating CODEOWNERS rules …
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,7 @@ | ||
# Lines starting with '#' are comments. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
# See: https://help.github.com/articles/about-codeowners/ | ||
|
||
# These owners will be the default owners for everything in the repo. | ||
* @NipunaRanasinghe @Nuvindu @shafreenAnfar |
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 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'ballerina-platform' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 21.0.3 | ||
- name: Change to Timestamped Version | ||
run: | | ||
startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00') | ||
latestCommit=$(git log -n 1 --pretty=format:"%h") | ||
VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev) | ||
updatedVersion=$VERSION-$startTime-$latestCommit | ||
echo $updatedVersion | ||
sed -i "s/version=\(.*\)/version=$updatedVersion/g" gradle.properties | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
env: | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
nexusUser: ${{ secrets.NEXUS_USERNAME }} | ||
nexusPassword: ${{ secrets.NEXUS_PASSWORD }} | ||
run: | | ||
./gradlew clean build publish --stacktrace --scan --console=plain |
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,52 @@ | ||
name: Publish to the Ballerina central | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: choice | ||
description: Select environment | ||
required: true | ||
options: | ||
- DEV CENTRAL | ||
- STAGE CENTRAL | ||
|
||
jobs: | ||
publish-release: | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'ballerina-platform' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 21.0.3 | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Ballerina Central Dev Push | ||
if: ${{ github.event.inputs.environment == 'DEV CENTRAL' }} | ||
env: | ||
BALLERINA_DEV_CENTRAL: true | ||
BALLERINA_STAGE_CENTRAL: false | ||
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }} | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties | ||
./gradlew clean build -PpublishToCentral=true | ||
- name: Ballerina Central Stage Push | ||
if: ${{ github.event.inputs.environment == 'STAGE CENTRAL' }} | ||
env: | ||
BALLERINA_DEV_CENTRAL: false | ||
BALLERINA_STAGE_CENTRAL: true | ||
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }} | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties | ||
./gradlew clean build -PpublishToCentral=true |
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,41 @@ | ||
name: PR build | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
ubuntu-build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 21.0.3 | ||
- name: Build with Gradle | ||
env: | ||
packageUser: ${{ github.actor }} | ||
packagePAT: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
./gradlew build --stacktrace --scan --console=plain --no-daemon | ||
windows-build: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 21.0.3 | ||
- name: Build with Gradle | ||
env: | ||
packageUser: ${{ github.actor }} | ||
packagePAT: ${{ secrets.GITHUB_TOKEN }} | ||
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 | ||
run: ./gradlew.bat build --stacktrace --scan --console=plain --no-daemon |
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
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,48 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 Inc. (http://www.wso2.com). | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
plugins { | ||
id "de.undercouch.download" | ||
} | ||
|
||
apply plugin: 'java' | ||
|
||
task downloadCheckstyleRuleFiles(type: Download) { | ||
src([ | ||
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.4/checkstyle/jdk-17/checkstyle.xml', | ||
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.4/checkstyle/jdk-17/suppressions.xml' | ||
]) | ||
overwrite false | ||
onlyIfNewer true | ||
dest buildDir | ||
} | ||
|
||
jar { | ||
enabled = false | ||
} | ||
|
||
clean { | ||
enabled = false | ||
} | ||
|
||
artifacts.add('default', file("$project.buildDir/checkstyle.xml")) { | ||
builtBy('downloadCheckstyleRuleFiles') | ||
} | ||
|
||
artifacts.add('default', file("$project.buildDir/suppressions.xml")) { | ||
builtBy('downloadCheckstyleRuleFiles') | ||
} |
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,9 @@ | ||
[tool] | ||
id = "xsd" | ||
|
||
[[dependency]] | ||
path = "lib/[email protected]@.jar" | ||
|
||
[[dependency]] | ||
path = "lib/[email protected]@.jar" | ||
|
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,12 @@ | ||
[package] | ||
distribution = "2201.11.0" | ||
org = "ballerina" | ||
name = "xsdtool" | ||
version = "@toml.version@" | ||
authors = ["Ballerina"] | ||
keywords = ["xsd", "xsd-tool"] | ||
repository = "https://github.com/ballerina-platform/xsd-tools" | ||
license = ["Apache-2.0"] | ||
|
||
[build-options] | ||
observabilityIncluded = false |
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,99 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com) | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
plugins { | ||
id "com.github.spotbugs-base" version "${spotbugsPluginVersion}" | ||
id "com.github.johnrengelman.shadow" version "${shadowJarPluginVersion}" | ||
id "de.undercouch.download" version "${downloadPluginVersion}" | ||
id "net.researchgate.release" version "${releasePluginVersion}" | ||
} | ||
|
||
allprojects { | ||
group = project.group | ||
version = project.version | ||
|
||
apply plugin: 'jacoco' | ||
apply plugin: 'maven-publish' | ||
|
||
repositories { | ||
mavenLocal() | ||
maven { | ||
url = 'https://maven.wso2.org/nexus/content/repositories/releases/' | ||
} | ||
maven { | ||
url = 'https://maven.wso2.org/nexus/content/groups/wso2-public/' | ||
} | ||
|
||
maven { | ||
url = 'https://maven.wso2.org/nexus/content/repositories/orgballerinalang-1614' | ||
} | ||
|
||
maven { | ||
url = 'https://repo.maven.apache.org/maven2' | ||
} | ||
|
||
maven { | ||
url = 'https://maven.pkg.github.com/ballerina-platform/*' | ||
credentials { | ||
username System.getenv("packageUser") | ||
password System.getenv("packagePAT") | ||
} | ||
} | ||
|
||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
|
||
ext { | ||
snapshotVersion= '-SNAPSHOT' | ||
timestampedVersionRegex = '.*-\\d{8}-\\d{6}-\\w.*\$' | ||
} | ||
} | ||
|
||
def moduleVersion = project.version.replace("-SNAPSHOT", "") | ||
|
||
release { | ||
failOnPublishNeeded = false | ||
failOnSnapshotDependencies = true | ||
|
||
buildTasks = ['build'] | ||
versionPropertyFile = 'gradle.properties' | ||
tagTemplate = 'v$version' | ||
|
||
git { | ||
requireBranch = "release-${moduleVersion}" | ||
pushToRemote = 'origin' | ||
} | ||
} | ||
|
||
tasks.register('clean') { | ||
dependsOn(":module-ballerina-xsd:clean") | ||
} | ||
|
||
tasks.register('build') { | ||
dependsOn(":module-ballerina-xsd:build") | ||
} | ||
|
||
tasks.register('test') { | ||
dependsOn(":module-ballerina-xsd:test") | ||
dependsOn(":xsd-core:test") | ||
} | ||
|
||
publishToMavenLocal.dependsOn build | ||
publish.dependsOn build |
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,22 @@ | ||
org.gradle.caching=true | ||
group=io.ballerina | ||
version=0.1.0-SNAPSHOT | ||
|
||
# Dependencies | ||
ballerinaLangVersion=2201.10.0 | ||
checkstylePluginVersion=10.12.0 | ||
spotbugsPluginVersion=5.0.14 | ||
shadowJarPluginVersion=8.1.1 | ||
downloadPluginVersion=5.4.0 | ||
releasePluginVersion=2.8.0 | ||
|
||
xsd4jVersion=1.6.3 | ||
apacheXmlSchemaVersion=1.4.7 | ||
picocliVersion=4.0.1 | ||
junitVersion=4.13.1 | ||
junitEngineVersion=5.8.2 | ||
junitParamVersion=5.10.1 | ||
testngVersion=7.7.0 | ||
|
||
# Stdlib Level 01 | ||
stdlibIoVersion=1.6.0 |
Binary file not shown.
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,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.