Skip to content

Commit

Permalink
Merge pull request #154 from Nuvindu/eof
Browse files Browse the repository at this point in the history
Change EOF format to LF
  • Loading branch information
ThisaruGuruge authored Apr 15, 2024
2 parents 07865f5 + 4cf4f16 commit 45ce9b7
Show file tree
Hide file tree
Showing 10 changed files with 1,197 additions and 1,197 deletions.
32 changes: 16 additions & 16 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
distribution = "2201.8.0"
org = "ballerinax"
name = "googleapis.gcalendar"
version = "4.0.1"
license = ["Apache-2.0"]
authors = ["Ballerina"]
keywords = ["Productivity/Calendars", "Cost/Free", "Vendor/Google", "Collaboration", "Enterprise IT", "Management"]
icon = "icon.png"
repository = "https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar"

[build-options]
observabilityIncluded = true

[platform.java17]
graalvmCompatible = true
[package]
distribution = "2201.8.0"
org = "ballerinax"
name = "googleapis.gcalendar"
version = "4.0.1"
license = ["Apache-2.0"]
authors = ["Ballerina"]
keywords = ["Productivity/Calendars", "Cost/Free", "Vendor/Google", "Collaboration", "Enterprise IT", "Management"]
icon = "icon.png"
repository = "https://github.com/ballerina-platform/module-ballerinax-googleapis.calendar"

[build-options]
observabilityIncluded = true

[platform.java17]
graalvmCompatible = true
200 changes: 100 additions & 100 deletions ballerina/build.gradle
Original file line number Diff line number Diff line change
@@ -1,100 +1,100 @@
/*
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) 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.
*/

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

plugins {
id 'io.ballerina.plugin'
}

description = 'Calendar - Ballerina'

def packageName = "googleapis.gcalendar"
def packageOrg = "ballerinax"
def tomlVersion = stripBallerinaExtensionVersion("${project.version}")
def ballerinaTomlFilePlaceHolder = new File("${project.rootDir}/build-config/resources/Ballerina.toml")
def ballerinaTomlFile = new File("$project.projectDir/Ballerina.toml")

def stripBallerinaExtensionVersion(String extVersion) {
if (extVersion.matches(project.ext.timestampedVersionRegex)) {
def splitVersion = extVersion.split('-')
if (splitVersion.length > 3) {
def strippedValues = splitVersion[0..-4]
return strippedValues.join('-')
} else {
return extVersion
}
} else {
return extVersion.replace("${project.ext.snapshotVersion}", "")
}
}

ballerina {
packageOrganization = packageOrg
module = packageName
testCoverageParam = "--code-coverage --coverage-format=xml"
isConnector = true
platform = "any"
}

task updateTomlFiles {
doLast {
def newBallerinaToml = ballerinaTomlFilePlaceHolder.text.replace("@project.version@", project.version)
newBallerinaToml = newBallerinaToml.replace("@toml.version@", tomlVersion)
ballerinaTomlFile.text = newBallerinaToml
}
}

task commitTomlFiles {
doLast {
project.exec {
ignoreExitValue true
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "git commit -m \"[Automated] Update the toml files\" Ballerina.toml Dependencies.toml"
} else {
commandLine 'sh', '-c', "git commit -m '[Automated] Update the toml files' Ballerina.toml Dependencies.toml"
}
}
}
}

publishing {
publications {
maven(MavenPublication) {
artifact source: createArtifactZip, extension: 'zip'
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/ballerina-platform/module-${packageOrg}-${packageName}")
credentials {
username = System.getenv("publishUser")
password = System.getenv("publishPAT")
}
}
}
}

clean {
delete 'build'
}

build.dependsOn "generatePomFileForMavenPublication"
publishToMavenLocal.dependsOn build
publish.dependsOn build
/*
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) 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.
*/

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

plugins {
id 'io.ballerina.plugin'
}

description = 'Calendar - Ballerina'

def packageName = "googleapis.gcalendar"
def packageOrg = "ballerinax"
def tomlVersion = stripBallerinaExtensionVersion("${project.version}")
def ballerinaTomlFilePlaceHolder = new File("${project.rootDir}/build-config/resources/Ballerina.toml")
def ballerinaTomlFile = new File("$project.projectDir/Ballerina.toml")

def stripBallerinaExtensionVersion(String extVersion) {
if (extVersion.matches(project.ext.timestampedVersionRegex)) {
def splitVersion = extVersion.split('-')
if (splitVersion.length > 3) {
def strippedValues = splitVersion[0..-4]
return strippedValues.join('-')
} else {
return extVersion
}
} else {
return extVersion.replace("${project.ext.snapshotVersion}", "")
}
}

ballerina {
packageOrganization = packageOrg
module = packageName
testCoverageParam = "--code-coverage --coverage-format=xml"
isConnector = true
platform = "any"
}

task updateTomlFiles {
doLast {
def newBallerinaToml = ballerinaTomlFilePlaceHolder.text.replace("@project.version@", project.version)
newBallerinaToml = newBallerinaToml.replace("@toml.version@", tomlVersion)
ballerinaTomlFile.text = newBallerinaToml
}
}

task commitTomlFiles {
doLast {
project.exec {
ignoreExitValue true
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "git commit -m \"[Automated] Update the toml files\" Ballerina.toml Dependencies.toml"
} else {
commandLine 'sh', '-c', "git commit -m '[Automated] Update the toml files' Ballerina.toml Dependencies.toml"
}
}
}
}

publishing {
publications {
maven(MavenPublication) {
artifact source: createArtifactZip, extension: 'zip'
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/ballerina-platform/module-${packageOrg}-${packageName}")
credentials {
username = System.getenv("publishUser")
password = System.getenv("publishPAT")
}
}
}
}

clean {
delete 'build'
}

build.dependsOn "generatePomFileForMavenPublication"
publishToMavenLocal.dependsOn build
publish.dependsOn build
36 changes: 18 additions & 18 deletions ballerina/error.bal
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Copyright (c) 2023, WSO2 LLC. (http://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.

# Represents any error related to the `gcalendar` module.
public type Error distinct error;
// Copyright (c) 2023, WSO2 LLC. (http://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.

# Represents any error related to the `gcalendar` module.
public type Error distinct error;
74 changes: 37 additions & 37 deletions ballerina/tests/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# Running Tests

There are two test environments for the Google Calendar connector. The default test environment is the mock server for Calendar API. The other test environment is testing against the actual Calendar API endpoint. You can run the tests in either of these environments.

## Running Tests against the Mock Server

To execute the tests on the mock server, ensure that the `IS_TEST_ON_LIVE_SERVER` environment variable is either set to false or unset before initiating the tests.

You can set your authentication credentials as environment variables:

```bash
export IS_TEST_ON_LIVE_SERVER=false
```

Then, run the following command to run the tests:

```bash
./gradlew clean test
```

## Running Tests against the Live Endpoint

You can set your authentication credentials as environment variables:

```bash
export IS_TEST_ON_LIVE_SERVER=true
export CLIENT_ID="<your-google-account-client-id>"
export CLIENT_SECRET="<your-google-account-client-secret>"
export REFRESH_TOKEN="<refresh-token-for-authorized-calendar-api>"
export REFRESH_URL="<refresh-url>"
```

Then, run the following command to run the tests:

```bash
./gradlew clean test
```
# Running Tests

There are two test environments for the Google Calendar connector. The default test environment is the mock server for Calendar API. The other test environment is testing against the actual Calendar API endpoint. You can run the tests in either of these environments.

## Running Tests against the Mock Server

To execute the tests on the mock server, ensure that the `IS_TEST_ON_LIVE_SERVER` environment variable is either set to false or unset before initiating the tests.

You can set your authentication credentials as environment variables:

```bash
export IS_TEST_ON_LIVE_SERVER=false
```

Then, run the following command to run the tests:

```bash
./gradlew clean test
```

## Running Tests against the Live Endpoint

You can set your authentication credentials as environment variables:

```bash
export IS_TEST_ON_LIVE_SERVER=true
export CLIENT_ID="<your-google-account-client-id>"
export CLIENT_SECRET="<your-google-account-client-secret>"
export REFRESH_TOKEN="<refresh-token-for-authorized-calendar-api>"
export REFRESH_URL="<refresh-url>"
```

Then, run the following command to run the tests:

```bash
./gradlew clean test
```
Loading

0 comments on commit 45ce9b7

Please sign in to comment.