Skip to content

Commit

Permalink
Merge pull request #21 from prakanth97/issue_6559
Browse files Browse the repository at this point in the history
Add constraint validation
  • Loading branch information
prakanth97 authored Jul 31, 2024
2 parents 194831e + a348f15 commit ab3dfe3
Show file tree
Hide file tree
Showing 17 changed files with 711 additions and 29 deletions.
6 changes: 6 additions & 0 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ groupId = "io.ballerina.lib"
artifactId = "data-native"
version = "1.0.0"
path = "../native/build/libs/data.xmldata-native-1.0.0-SNAPSHOT.jar"

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "constraint-native"
version = "1.5.0"
path = "./lib/constraint-native-1.5.0.jar"
28 changes: 27 additions & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,28 @@
dependencies-toml-version = "2"
distribution-version = "2201.10.0-20240724-114000-40e856f7"

[[package]]
org = "ballerina"
name = "constraint"
version = "1.5.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
modules = [
{org = "ballerina", packageName = "constraint", moduleName = "constraint"}
]

[[package]]
org = "ballerina"
name = "data.xmldata"
version = "1.0.0"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "test"}
{org = "ballerina", name = "test"},
{org = "ballerina", name = "time"}
]
modules = [
{org = "ballerina", packageName = "data.xmldata", moduleName = "data.xmldata"}
Expand Down Expand Up @@ -99,3 +113,15 @@ modules = [
{org = "ballerina", packageName = "test", moduleName = "test"}
]

[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
modules = [
{org = "ballerina", packageName = "time", moduleName = "time"}
]

15 changes: 15 additions & 0 deletions ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,25 @@ ballerina {
testCoverageParam = "--code-coverage --coverage-format=xml --includes=io.ballerina.lib.data.xmldata*:ballerina.*"
}

configurations {
externalJars
}

dependencies {
externalJars(group: 'io.ballerina.stdlib', name: 'constraint-native', version: "${stdlibConstraintVersion}") {
transitive = false
}
}

task updateTomlFiles {
doLast {
def stdlibDependentConstraintNativeVersion = stdlibConstraintVersion
def stdlibDependentConstraintVersion = stripBallerinaExtensionVersion("${stdlibDependentConstraintNativeVersion}")

def newConfig = ballerinaTomlFilePlaceHolder.text.replace("@project.version@", project.version)
newConfig = newConfig.replace("@toml.version@", tomlVersion)
newConfig = newConfig.replace("@stdlib.constraintnative.version@", stdlibDependentConstraintNativeVersion)
newConfig = newConfig.replace("@constraint.version@", stdlibDependentConstraintVersion)
ballerinaTomlFile.text = newConfig

def newCompilerPluginToml = compilerPluginTomlFilePlaceHolder.text.replace("@project.version@", project.version)
Expand Down
Loading

0 comments on commit ab3dfe3

Please sign in to comment.