Skip to content

Commit

Permalink
Merge pull request #7 from ballerina-platform/test
Browse files Browse the repository at this point in the history
Make the module GraalVM compatible
  • Loading branch information
TharmiganK committed Jul 26, 2023
2 parents 52158a9 + 7706bbf commit 8fa964a
Show file tree
Hide file tree
Showing 13 changed files with 257 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/central-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build -x test
run: ./gradlew build -x check -x test
- name: Create lib directory if not exists
run: mkdir -p ballerina/lib
- name: Run Trivy vulnerability scanner
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
git config --global user.name ${{ secrets.BALLERINA_BOT_USERNAME }}
git config --global user.email ${{ secrets.BALLERINA_BOT_EMAIL }}
./gradlew build -x test
./gradlew build -x check -x test
- name: Create lib directory if not exists
run: mkdir -p ballerina/lib
- name: Run Trivy vulnerability scanner
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build -x test
run: ./gradlew build -x check -x test
- name: Create lib directory if not exists
run: mkdir -p ballerina/lib
- name: Run Trivy vulnerability scanner
Expand Down
11 changes: 10 additions & 1 deletion ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
[package]
org = "ballerinax"
name = "h2.driver"
version = "0.1.0"
version = "1.0.0"
authors = ["Ballerina"]
keywords = ["H2"]
repository = "https://github.com/ballerina-platform/module-ballerinax-h2.driver"
license = ["Apache-2.0"]
distribution = "2201.7.0"

[platform.java11]
graalvmCompatible = true

[[platform.java11.dependency]]
path = "./lib/h2-2.2.220.jar"

[[platform.java11.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "h2.driver-native"
version = "1.0.0"
path = "../native/build/libs/h2.driver-native-1.0.0-SNAPSHOT.jar"
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ distribution-version = "2201.7.0"
[[package]]
org = "ballerinax"
name = "h2.driver"
version = "0.1.0"
version = "1.0.0"
modules = [
{org = "ballerinax", packageName = "h2.driver", moduleName = "h2.driver"}
]
Expand Down
2 changes: 2 additions & 0 deletions ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,5 @@ publishing {

build.dependsOn "unpackJballerinaTools"
build.dependsOn "generatePomFileForMavenPublication"
build.dependsOn ":${packageName}-native:build"
test.dependsOn ":${packageName}-native:build"
9 changes: 9 additions & 0 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@ repository = "https://github.com/ballerina-platform/module-ballerinax-h2.driver"
license = ["Apache-2.0"]
distribution = "2201.7.0"

[platform.java11]
graalvmCompatible = true

[[platform.java11.dependency]]
path = "./lib/h2-@h2.driver.version@.jar"

[[platform.java11.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "h2.driver-native"
version = "@toml.version@"
path = "../native/build/libs/h2.driver-native-@project.version@.jar"
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ release {
}

task build {
dependsOn("${packageName}-native:build")
dependsOn("${packageName}-ballerina:build")
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=io.ballerina.stdlib
version=0.1.1-SNAPSHOT
version=1.0.0-SNAPSHOT

githubSpotbugsVersion=4.0.5
githubJohnrengelmanShadowVersion=5.2.0
Expand Down
39 changes: 39 additions & 0 deletions native/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2022 WSO2 LLC. (https: *www.wso2.com) All Rights Reserved.
*
* 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 'java'
}

description = 'Ballerina - H2 driver Java Native'

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

sourceCompatibility = JavaVersion.VERSION_11

compileJava {
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
[
{
"name": "org.h2.Driver"
},
{
"name":"org.h2.jdbcx.JdbcDataSource",
"queryAllPublicMethods":true,
"methods":[
{
"name":"<init>",
"parameterTypes":[]
},
{
"name":"setLoginTimeout",
"parameterTypes":["int"]
},
{
"name":"setPassword",
"parameterTypes":["java.lang.String"]
},
{
"name":"setUrl",
"parameterTypes":["java.lang.String"]
},
{
"name":"setUser",
"parameterTypes":["java.lang.String"]
}
]
},
{
"name": "org.h2.mvstore.db.LobStorageMap$BlobMeta$Type",
"fields": [
{
"name": "INSTANCE"
}
]
},
{
"name": "org.h2.mvstore.db.LobStorageMap$BlobReference$Type",
"fields": [
{
"name": "INSTANCE"
}
]
},
{
"name": "org.h2.mvstore.db.NullValueDataType",
"fields": [
{
"name": "INSTANCE"
}
]
},
{
"name": "org.h2.mvstore.db.RowDataType$Factory",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.mvstore.tx.VersionedValueType$Factory",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.mvstore.type.ByteArrayDataType",
"fields": [
{
"name": "INSTANCE"
}
]
},
{
"name": "org.h2.mvstore.type.LongDataType",
"fields": [
{
"name": "INSTANCE"
}
]
},
{
"name": "org.h2.store.fs.async.FilePathAsync",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.store.fs.disk.FilePathDisk",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.store.fs.mem.FilePathMem",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.store.fs.mem.FilePathMemLZF",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.store.fs.niomapped.FilePathNioMapped",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.store.fs.niomem.FilePathNioMem",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.store.fs.niomem.FilePathNioMemLZF",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.store.fs.retry.FilePathRetryOnInterrupt",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.store.fs.split.FilePathSplit",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.h2.store.fs.zip.FilePathZip",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"resources": {
"includes": [
{
"pattern": "\\Qorg/h2/util/data.zip\\E"
}
]
},
"bundles": []
}
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ plugins {

rootProject.name = 'ballerinax-h2.driver'

include ':h2.driver-native'
include ':h2.driver-ballerina'

project(':h2.driver-native').projectDir = file('native')
project(':h2.driver-ballerina').projectDir = file('ballerina')

gradleEnterprise {
Expand Down

0 comments on commit 8fa964a

Please sign in to comment.