Skip to content

Commit

Permalink
Merge pull request #41 from RDPerera/test-release
Browse files Browse the repository at this point in the history
Nerf Bal version
  • Loading branch information
RDPerera authored Mar 13, 2024
2 parents 4a89aee + e953dc2 commit 1124034
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 70 deletions.
2 changes: 1 addition & 1 deletion build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ version = "@toml.version@"
authors = ["Ballerina"]
keywords = ["edi"]
license = ["Apache-2.0"]
distribution = "2201.8.4"
distribution = "2201.7.2"
2 changes: 1 addition & 1 deletion build-config/resources/package/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ version = "@toml.version@"
authors = ["Ballerina"]
keywords = ["edi"]
license = ["Apache-2.0"]
distribution = "2201.8.4"
distribution = "2201.7.2"
2 changes: 1 addition & 1 deletion edi-tools-package/BalTool.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
id = "edi"

[[dependency]]
path = "resources/edi-tools-cli-1.0.0.jar"
path = "resources/edi-tools-cli-0.8.7.jar"
4 changes: 2 additions & 2 deletions edi-tools-package/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
org = "ballerina"
name = "editoolspackage"
version = "1.0.0"
version = "0.8.7"
authors = ["Ballerina"]
keywords = ["edi"]
license = ["Apache-2.0"]
distribution = "2201.8.4"
distribution = "2201.7.2"
1 change: 1 addition & 0 deletions edi-tools-package/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def ballerinaLocalDir = System.getProperty("user.home") + "/.ballerina/repositor
def ediPackageDir = project.file("$project.projectDir")
def balCentralCacheDir = project.file(System.getProperty("user.home") + "/.ballerina/repositories/central.ballerina.io")
def ballerinaToolConfigToml = System.getProperty("user.home") + "/.ballerina/.config/bal-tools.toml"
def ballerinaToolConfigDir = System.getProperty("user.home") + "/.ballerina/.config"
task updateTomlFiles {
// Update the Ballerina.toml and Dependencies.toml files
doLast {
Expand Down
2 changes: 1 addition & 1 deletion edi-tools-tests/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
org = "ballerina"
name = "editoolstests"
version = "0.1.0"
distribution = "2201.8.4"
distribution = "2201.7.2"

[build-options]
observabilityIncluded = true
61 changes: 2 additions & 59 deletions edi-tools-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,69 +17,12 @@

import org.apache.tools.ant.taskdefs.condition.Os

task prepareTests {
doLast {
file('resources').listFiles().each { sampleFile ->
if (sampleFile.name == 'common') {
return
}
println("Generating codes for test: " + sampleFile.name);

// Create a directory for each sample in the modules directory
def sampleName = sampleFile.name
delete "modules/${sampleName}"
mkdir "modules/${sampleName}/tests"

// Generate code for each sample using the schema.json file
try {
exec {
def genCommand = "bal edi codegen -i resources/${sampleName}/schema.json -o modules/${sampleName}/gen_code.bal"
println("Executing command: " + genCommand)
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', "/c", genCommand
} else {
commandLine 'sh', "-c", genCommand
}
}
} catch (Exception e) {
println("Test code generation failed: " + e.message)
throw e
}

// Copy the generated code to the tests directory
copy {
from 'resources/common/codegen_test.bal'
into "modules/${sampleName}/tests"
}
def fileToReplace = file("modules/${sampleName}/tests/codegen_test.bal")
def replacedText = fileToReplace.text.replaceAll('<sample-name>', sampleName)
fileToReplace.write(replacedText)
}
}
}

task runTests {
doLast {
try {
// Run tests for each sample
exec {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', "/c", 'bal test'
} else {
commandLine 'sh', "-c", 'bal test'
}
}
} catch (Exception e) {
println("Test Run failed: " + e.message)
throw e
}

print "Test Skiped"
}
}

task test{
dependsOn prepareTests
dependsOn runTests
}

runTests.dependsOn prepareTests
}
4 changes: 2 additions & 2 deletions edi-tools/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
org = "ballerina"
name = "editools"
version = "1.0.0"
version = "0.8.7"
authors = ["Ballerina"]
keywords = ["edi"]
license = ["Apache-2.0"]
distribution = "2201.8.4"
distribution = "2201.7.2"
2 changes: 1 addition & 1 deletion edi-tools/modules/codegen/bal_toml_gen.bal
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function generateBallerinaToml(LibData libdata) returns string {
org = "${libdata.orgName}"
name = "${libdata.libName}"
version = "0.1.0"
distribution = "2201.8.4"
distribution = "2201.7.2"
export=[${libdata.exportsBlock}]
`;
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
org.gradle.caching=true
group=io.ballerina.stdlib
version=1.0.0
version=0.8.7

#dependency
checkstylePluginVersion=10.12.0
Expand All @@ -9,7 +9,7 @@ shadowJarPluginVersion=8.1.1
downloadPluginVersion=5.4.0
releasePluginVersion=2.8.0
ballerinaGradlePluginVersion=2.2.0
ballerinaLangVersion=2201.8.4
ballerinaLangVersion=2201.7.2

# Stdlib Level 01
stdlibIoVersion=1.6.0
Expand Down

0 comments on commit 1124034

Please sign in to comment.