Skip to content

Commit

Permalink
Merge pull request #629 from xlight05/rename-package
Browse files Browse the repository at this point in the history
Change package name to 'azure.functions'
  • Loading branch information
xlight05 authored Jun 21, 2023
2 parents 7dcd5f5 + bc0f144 commit 14cc424
Show file tree
Hide file tree
Showing 48 changed files with 95 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
if: github.event.action == 'check_connector_for_breaking_changes'
run: |
echo "BUILD_USING_DOCKER=true" >> $GITHUB_ENV
echo "GRADLE_SKIP_TASKS=-x :azure_functions-compiler-plugin-tests:test" >> $GITHUB_ENV
echo "GRADLE_SKIP_TASKS=-x :azure.functions-compiler-plugin-tests:test" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ is the default Output binding. Of course, you can override the default behavior
return type.

```ballerina
import ballerinax/azure_functions as af;
import ballerinax/azure.functions as af;
service / on new af:HttpListener() {
resource function get hello(string name) returns string {
Expand All @@ -53,7 +53,7 @@ service / on new af:HttpListener() {

In the code sample shown above, it has an empty service path and resource path named `hello`. The accessor is `get`. It
expects a request with a query parameter for the field `name`. The required artifact generation and data binding will be
handled by `ballerinax/azure_functions` package automatically.
handled by `ballerinax/azure.functions` package automatically.

The Azure Functions functionality is implemented as a compiler extension. Thus, artifact generation happens automatically when you build a Ballerina module. Let's see how this works by building the above code.

Expand All @@ -63,7 +63,7 @@ Compiling source
wso2/azure_functions_deployment:0.1.0
Generating executable
@azure_functions:Function: get-hello
@azure.functions:Function: get-hello
Execute the below command to deploy the function locally:
func start --script-root target/azure_functions --java
Expand Down Expand Up @@ -148,7 +148,7 @@ All contributors are encouraged to read the [Ballerina Code of Conduct](https://

## Useful links

* For more information go to the [`azure_functions` library](https://lib.ballerina.io/ballerinax/azure_functions/latest).
* For more information go to the [`azure.functions` library](https://lib.ballerina.io/ballerinax/azure.functions/latest).
* For example demonstrations of the usage, go to [Ballerina By Examples](https://ballerina.io/learn/by-example/).
* Chat live with us via our [Discord server](https://discord.gg/ballerinalang).
* Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.
4 changes: 2 additions & 2 deletions ballerina-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerinax"
name = "azure_functions_tests"
version = "3.3.1"
name = "azure.functions.tests"
version = "4.0.0"

[build-options]
observabilityIncluded = true
Expand Down
4 changes: 2 additions & 2 deletions ballerina-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import org.apache.tools.ant.taskdefs.condition.Os

description = 'Ballerinax - Azure Functions Tests'

def packageName = "azure_functions"
def packageName = "azure.functions"
def packageOrg = "ballerinax"
def moduleName = "tests"
def tomlVersion = stripBallerinaExtensionVersion("${project.version}")
def ballerinaTomlFilePlaceHolder = new File("${project.rootDir}/build-config/resources/BallerinaTest.toml")
def ballerinaTomlFile = new File("$project.projectDir/Ballerina.toml")
def ballerinaDist = "${project.rootDir}/target/ballerina-runtime"
def distributionBinPath = "${ballerinaDist}/bin"
def testCoverageParam = "--test-report --code-coverage --coverage-format=xml --includes=io.ballerina.stdlib.azure.functions.*:ballerinax.azure_functions"
def testCoverageParam = "--test-report --code-coverage --coverage-format=xml --includes=io.ballerina.stdlib.azure.functions.*:ballerinax.azure.functions"

def stripBallerinaExtensionVersion(String extVersion) {
if (extVersion.matches(project.ext.timestampedVersionRegex)) {
Expand Down
2 changes: 1 addition & 1 deletion ballerina-tests/tests/http_default_databinding.bal
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// specific language governing permissions and limitations
// under the License.

import ballerinax/azure_functions as af;
import ballerinax/azure.functions as af;
import ballerina/http;
import ballerina/test;
import ballerina/lang.value;
Expand Down
2 changes: 1 addition & 1 deletion ballerina-tests/tests/http_validation.bal
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// specific language governing permissions and limitations
// under the License.

import ballerinax/azure_functions as af;
import ballerinax/azure.functions as af;
import ballerina/http;
import ballerina/io;
import ballerina/lang.value;
Expand Down
2 changes: 1 addition & 1 deletion ballerina-tests/tests/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// specific language governing permissions and limitations
// under the License.

import ballerinax/azure_functions as af;
import ballerinax/azure.functions as af;
import ballerina/http;
import ballerina/mime;

Expand Down
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerinax"
name = "azure_functions"
version = "3.3.1"
name = "azure.functions"
version = "4.0.0"
distribution = "2201.5.0"
repository = "https://github.com/ballerina-platform/module-ballerinax-azure.functions"
license = ["Apache-2.0"]
keywords = ["azure", "functions", "serverless", "cloud"]

[[platform.java11.dependency]]
path = "../native/build/libs/azure_functions-native-3.3.1-SNAPSHOT.jar"
path = "../native/build/libs/azure.functions-native-4.0.0-SNAPSHOT.jar"

[[platform.java11.dependency]]
groupId = "io.ballerina.stdlib"
Expand Down
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "azure-functions"
class = "org.ballerinax.azurefunctions.AzureCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/azure_functions-compiler-plugin-3.3.1-SNAPSHOT.jar"
path = "../compiler-plugin/build/libs/azure.functions-compiler-plugin-4.0.0-SNAPSHOT.jar"
24 changes: 11 additions & 13 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "crypto"
version = "2.3.0"
version = "2.3.1"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand All @@ -51,13 +51,11 @@ dependencies = [
[[package]]
org = "ballerina"
name = "file"
version = "1.7.0"
version = "1.7.1"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "os"},
{org = "ballerina", name = "regex"},
{org = "ballerina", name = "time"}
]

Expand Down Expand Up @@ -95,7 +93,7 @@ modules = [
[[package]]
org = "ballerina"
name = "io"
version = "1.4.0"
version = "1.4.1"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.value"}
Expand Down Expand Up @@ -204,7 +202,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.7.0"
version = "2.7.1"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -218,7 +216,7 @@ modules = [
[[package]]
org = "ballerina"
name = "mime"
version = "2.7.0"
version = "2.7.1"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -261,7 +259,7 @@ modules = [
[[package]]
org = "ballerina"
name = "regex"
version = "1.4.2"
version = "1.4.3"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.string"}
Expand All @@ -279,23 +277,23 @@ dependencies = [
[[package]]
org = "ballerina"
name = "time"
version = "2.2.4"
version = "2.2.5"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "url"
version = "2.2.3"
version = "2.2.4"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerinax"
name = "azure_functions"
version = "3.3.1"
name = "azure.functions"
version = "4.0.0"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -304,6 +302,6 @@ dependencies = [
{org = "ballerina", name = "os"}
]
modules = [
{org = "ballerinax", packageName = "azure_functions", moduleName = "azure_functions"}
{org = "ballerinax", packageName = "azure.functions", moduleName = "azure.functions"}
]

4 changes: 2 additions & 2 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ is the default Output binding. Of course, you can override the default behavior
return type.

```ballerina
import ballerinax/azure_functions as af;
import ballerinax/azure.functions as af;
service / on new af:HttpListener() {
resource function get hello(string name) returns string {
Expand All @@ -43,4 +43,4 @@ service / on new af:HttpListener() {

In the code sample shown above, it has an empty service path and resource path named `hello`. The accessor is `get`. It
expects a request with a query parameter for the field `name`. The required artifact generation and data binding will be
handled by `ballerinax/azure_functions` package automatically.
handled by `ballerinax/azure.functions` package automatically.
2 changes: 1 addition & 1 deletion ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ buildscript {

description = 'Ballerinax - Azure Functions Extension Annotations'

def packageName = "azure_functions"
def packageName = "azure.functions"
def packageOrg = "ballerinax"

def tomlVersion = stripBallerinaExtensionVersion("${project.version}")
Expand Down
4 changes: 2 additions & 2 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
org = "ballerinax"
name = "azure_functions"
name = "azure.functions"
version = "@toml.version@"
distribution = "2201.5.0"
repository = "https://github.com/ballerina-platform/module-ballerinax-azure.functions"
license = ["Apache-2.0"]
keywords = ["azure", "functions", "serverless", "cloud"]

[[platform.java11.dependency]]
path = "../native/build/libs/azure_functions-native-@project.version@.jar"
path = "../native/build/libs/azure.functions-native-@project.version@.jar"

[[platform.java11.dependency]]
groupId = "io.ballerina.stdlib"
Expand Down
2 changes: 1 addition & 1 deletion build-config/resources/BallerinaTest.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
org = "ballerinax"
name = "azure_functions_tests"
name = "azure.functions.tests"
version = "@toml.version@"

[build-options]
Expand Down
2 changes: 1 addition & 1 deletion build-config/resources/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "azure-functions"
class = "org.ballerinax.azurefunctions.AzureCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/azure_functions-compiler-plugin-@project.version@.jar"
path = "../compiler-plugin/build/libs/azure.functions-compiler-plugin-@project.version@.jar"
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@ release {
}

task build {
dependsOn('azure_functions-ballerina:build')
dependsOn('azure.functions-ballerina:build')
}
4 changes: 2 additions & 2 deletions compiler-plugin-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
apply from: "$rootDir/gradle/javaProject.gradle"

dependencies {
implementation project(':azure_functions-compiler-plugin')
implementation project(':azure.functions-compiler-plugin')

testImplementation "org.ballerinalang:ballerina-lang:${ballerinaLangVersion}"
testImplementation "org.ballerinalang:ballerina-parser:${ballerinaLangVersion}"
Expand Down Expand Up @@ -81,7 +81,7 @@ jacocoTestReport {
}
}

test.dependsOn ":azure_functions-ballerina:build"
test.dependsOn ":azure.functions-ballerina:build"


// Disable publishing artifacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void testAzureFunctionsDeploymentProject() throws Exception {
Files.deleteIfExists(depedenciesToml);
ProcessOutput processOutput = TestUtils.compileProject(handlers, false, false, false, null);
Assert.assertEquals(processOutput.getExitCode(), 0);
Assert.assertTrue(processOutput.getStdOutput().contains("@azure_functions"));
Assert.assertTrue(processOutput.getStdOutput().contains("@azure.functions"));

// check if the executable jar and the host.json files are in the generated zip file
Path zipFilePath = handlers.resolve("target").resolve("azure_functions");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void testAzureFunctionsDeploymentProject() throws Exception {
Files.deleteIfExists(depedenciesToml);
ProcessOutput processOutput = TestUtils.compileProject(handlers, false, false, false, null);
Assert.assertEquals(processOutput.getExitCode(), 0);
Assert.assertTrue(processOutput.getStdOutput().contains("@azure_functions"));
Assert.assertTrue(processOutput.getStdOutput().contains("@azure.functions"));

// check if the executable jar and the host.json files are in the generated zip file
Path zipFilePath = handlers.resolve("target").resolve("azure_functions");
Expand All @@ -66,7 +66,7 @@ public void testAzureFunctionsSingleFilePackage() throws Exception {
Files.deleteIfExists(depedenciesToml);
ProcessOutput processOutput = TestUtils.compileProject(handlers, false, false, false, "main.bal");
Assert.assertEquals(processOutput.getExitCode(), 0);
Assert.assertTrue(processOutput.getStdOutput().contains("@azure_functions"));
Assert.assertTrue(processOutput.getStdOutput().contains("@azure.functions"));
Assert.assertTrue(processOutput.getStdOutput().contains("Warning:"));
Assert.assertTrue(processOutput.getStdOutput().contains("--script-root azure_functions"));
// check if the executable jar and the host.json files are in the generated zip file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public class NativeTest {

private static final Path SOURCE_DIR = Paths.get("src").resolve("test").resolve("resources");

@Test
@Test()
public void testNativeAzureFunctionsLocal() throws Exception {
Path handlers = SOURCE_DIR.resolve("handlers");
Path depedenciesToml = handlers.resolve("Dependencies.toml");
Files.deleteIfExists(depedenciesToml);
ProcessOutput processOutput = TestUtils.compileProject(handlers, true, false, true, null);
Assert.assertEquals(processOutput.getExitCode(), 0);
Assert.assertTrue(processOutput.getStdOutput().contains("@azure_functions"));
Assert.assertTrue(processOutput.getStdOutput().contains("@azure.functions"));

// check if the executable jar and the host.json files are in the generated zip file
Path target = handlers.resolve("target");
Expand All @@ -62,7 +62,7 @@ public void testNativeAzureFunctionsLocal() throws Exception {
Files.deleteIfExists(depedenciesToml);
}

@Test
@Test(dependsOnMethods = "testNativeAzureFunctionsLocal")
public void testNativeAzureFunctionsRemote() throws Exception {
if (isWindows()) {
//As of now, compiling into linux from windows containers is not supported. Therefore, it'll fail in
Expand All @@ -75,7 +75,7 @@ public void testNativeAzureFunctionsRemote() throws Exception {
Files.deleteIfExists(depedenciesToml);
ProcessOutput processOutput = TestUtils.compileProject(handlers, true, false, false, null);
Assert.assertEquals(processOutput.getExitCode(), 0);
Assert.assertTrue(processOutput.getStdOutput().contains("@azure_functions"));
Assert.assertTrue(processOutput.getStdOutput().contains("@azure.functions"));

// check if the executable jar and the host.json files are in the generated zip file
Path target = handlers.resolve("target");
Expand All @@ -97,7 +97,7 @@ private static boolean isWindows() {
return System.getProperty("os.name").toLowerCase().contains("win");
}

@Test
@Test(dependsOnMethods = "testNativeAzureFunctionsRemote")
public void testNativeAzureFunctionsBuildFail() throws Exception {
Path handlers = SOURCE_DIR.resolve("handlers");
Path depedenciesToml = handlers.resolve("Dependencies.toml");
Expand All @@ -108,19 +108,19 @@ public void testNativeAzureFunctionsBuildFail() throws Exception {
}
String stdOutput = processOutput.getStdOutput();
String stdErr = processOutput.getErrOutput();
Assert.assertTrue(stdOutput.contains("@azure_functions"));
Assert.assertTrue(stdOutput.contains("@azure.functions"));
Assert.assertTrue(stdErr.contains("Native executable generation for cloud using docker failed"));
Files.deleteIfExists(depedenciesToml);
}

@Test
@Test(dependsOnMethods = "testNativeAzureFunctionsBuildFail")
public void testNativeAzureFunctionsLocalSingle() throws Exception {
Path handlers = SOURCE_DIR.resolve("single-native");
Path depedenciesToml = handlers.resolve("Dependencies.toml");
Files.deleteIfExists(depedenciesToml);
ProcessOutput processOutput = TestUtils.compileProject(handlers, true, false, true, "main.bal");
Assert.assertEquals(processOutput.getExitCode(), 0);
Assert.assertTrue(processOutput.getStdOutput().contains("@azure_functions"));
Assert.assertTrue(processOutput.getStdOutput().contains("@azure.functions"));
Assert.assertFalse(processOutput.getStdOutput().contains("Warning:"));
Assert.assertTrue(processOutput.getStdOutput().contains("--script-root azure_functions"));
// check if the executable jar and the host.json files are in the generated zip file
Expand Down
Loading

0 comments on commit 14cc424

Please sign in to comment.