@@ -40,16 +40,34 @@ if ([string]::IsNullOrEmpty($pluginVersion))
4040StopOnFailedExecution
4141
4242
43- # Get azure-functions-library
44- Write-Host " Build and install azure-functions-java-library"
43+ # Get azure-functions-core-library
44+ Write-Host " Build and install azure-functions-java-core-library"
45+ cmd.exe / c ' .\mvnBuild.bat'
46+ StopOnFailedExecution
47+ $coreLibraryPom = Get-Content " pom.xml" - Raw
48+ $coreLibraryPom -match " <version>(.*)</version>"
49+ $coreLibraryVersion = $matches [1 ]
50+ Write-Host " coreLibraryVersion: " $coreLibraryVersion
51+
52+ # Get azure-functions-library
53+ git clone https:// github.com / Azure/ azure- functions- java- library.git - b dev
54+ Push-Location - Path " ./azure-functions-java-library" - StackName libraryDir
55+ Write-Host " Updating azure-functions-java-library to use current version of azure-functions-java-core-library"
56+ cmd.exe / c .\..\updateVersions.bat $coreLibraryVersion
57+ Write-Host " Building azure-functions-java-library"
4558cmd.exe / c ' .\mvnBuild.bat'
4659StopOnFailedExecution
4760$libraryPom = Get-Content " pom.xml" - Raw
4861$libraryPom -match " <version>(.*)</version>"
4962$libraryVersion = $matches [1 ]
5063Write-Host " libraryVersion: " $libraryVersion
64+ Pop-Location - StackName " libraryDir"
5165
5266# Download azure-functions-core-tools
67+ $FUNC_RUNTIME_VERSION = ' 4'
68+ $arch = [System.Runtime.InteropServices.RuntimeInformation ]::OSArchitecture.ToString().ToLowerInvariant()
69+ $os = if ($IsWindows ) { " win" } else { if ($IsMacOS ) { " osx" } else { " linux" } }
70+
5371$currDir = Get-Location
5472$skipCliDownload = $false
5573if ($args [0 ])
@@ -64,11 +82,11 @@ Remove-Item -Force ./Azure.Functions.Cli.zip -ErrorAction Ignore
6482Remove-Item - Recurse - Force ./ Azure.Functions.Cli - ErrorAction Ignore
6583
6684Write-Host " Downloading Functions Core Tools...."
67- Invoke-RestMethod - Uri ' https://functionsclibuilds.blob.core.windows.net/builds/2 /latest/version.txt' - OutFile version.txt
85+ Invoke-RestMethod - Uri " https://functionsclibuilds.blob.core.windows.net/builds/$FUNC_RUNTIME_VERSION /latest/version.txt" - OutFile version.txt
6886Write-Host " Using Functions Core Tools version: $ ( Get-Content - Raw version.txt) "
6987Remove-Item version.txt
7088
71- $url = " https://functionsclibuilds.blob.core.windows.net/builds/2 /latest/Azure.Functions.Cli.win-x86 .zip"
89+ $url = " https://functionsclibuilds.blob.core.windows.net/builds/$FUNC_RUNTIME_VERSION /latest/Azure.Functions.Cli.$os - $arch .zip"
7290$output = " $currDir \Azure.Functions.Cli.zip"
7391$wc = New-Object System.Net.WebClient
7492$wc.DownloadFile ($url , $output )
@@ -78,32 +96,30 @@ Expand-Archive ".\Azure.Functions.Cli.zip" -DestinationPath ".\Azure.Functions.C
7896}
7997$Env: Path = $Env: Path + " ;$currDir \Azure.Functions.Cli"
8098
81- # Generate HttpTrigger Function via archetype version built above
82- md - Name ciTestDir
83- Push-Location - Path " ./ciTestDir" - StackName libraryDir
84- Write-Host " Generating project with archetype"
85- cmd.exe / c ' .\..\mvnGenerateArchetype.bat' $atchetypeVersion
86- Pop-Location - StackName " libraryDir"
87-
88- # Build HttpTrigger Function
89-
90- Push-Location - Path " ./ciTestDir/e2etestproject" - StackName libraryDir
91- Remove-Item - Recurse - Force " src/test" - ErrorAction Ignore
92- cmd.exe / c .\..\..\updateVersions.bat $libraryVersion $pluginVersion
93- StopOnFailedExecution
94- # Update versions in the HttpTrigger pom.xml
95- cmd.exe / c ' .\..\..\mvnBuild.bat'
96- StopOnFailedExecution
97- Pop-Location - StackName " libraryDir"
98-
9999# Clone and build azure-functions-java-worker
100100git clone https:// github.com / azure/ azure- functions- java- worker - b dev
101101Push-Location - Path " ./azure-functions-java-worker" - StackName libraryDir
102- Write-Host " Updating azure-functions-java-worker to use current version of library"
102+ Write-Host " Updating azure-functions-java-worker to use current version of the java core library"
103103
104- cmd.exe / c .\..\updateVersions.bat $libraryVersion
104+ cmd.exe / c .\..\updateVersions.bat $coreLibraryVersion
105105Write-Host " Building azure-functions-java-worker"
106106cmd.exe / c ' .\mvnBuild.bat'
107107StopOnFailedExecution
108108Pop-Location - StackName " libraryDir"
109109
110+ # Update core tools with the new Java worker
111+ Write-Host " Replacing Java worker binaries in the Core Tools..."
112+ Get-ChildItem - Path " ./azure-functions-java-worker/target/*" - Include ' azure*' - Exclude ' *shaded.jar' , ' *tests.jar' | ForEach-Object {
113+ Copy-Item $_.FullName " ./Azure.Functions.Cli/workers/java/azure-functions-java-worker.jar" - Force - Verbose
114+ }
115+ Copy-Item - Path " .\Azure.Functions.Cli" - Destination " .\azure-functions-java-worker\Azure.Functions.Cli" - Recurse
116+
117+ # Updating end to end tests with the new library
118+ Push-Location - Path " ./azure-functions-java-worker/endtoendtests" - StackName libraryDir
119+ Write-Host " Updating azure-functions-java-worker endtoendtests to use current version of the java core library"
120+
121+ cmd.exe / c .\..\..\updateVersions.bat $coreLibraryVersion $libraryVersion $pluginVersion
122+ Write-Host " Building azure-functions-java-worker end to end tests"
123+ cmd.exe / c ' .\..\..\mvnBuild.bat'
124+ StopOnFailedExecution
125+ Pop-Location - StackName " libraryDir"
0 commit comments