-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into #685-ios-support-for-testplans
- Loading branch information
Showing
82 changed files
with
1,593 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SET DIR=%~dp0 | ||
%DIR%\..\..\flank-scripts\bash\flankScripts.bat shell firebase generateJavaClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,2 @@ | ||
#!/bin/bash | ||
|
||
# Note: Must have already installed google-apis-client-generator from the master branch. PIP release will not work! | ||
|
||
# git clone https://github.com/google/apis-client-generator.git | ||
# xcode-select --install | ||
# brew install python@2 | ||
# export PATH="/usr/local/opt/python@2/libexec/bin:$PATH" | ||
# pip install --upgrade pip setuptools | ||
# pip install . | ||
|
||
# Generate only the testing library since the others are published officially already. | ||
|
||
# generate_library \ | ||
# --input=./storage_v1.json \ | ||
# --language=java \ | ||
# --output_dir=./storage | ||
|
||
rm -rf "./test_api/src/" | ||
|
||
generate_library \ | ||
--input=./json/testing_v1.json \ | ||
--language=java \ | ||
--package_path=api/services \ | ||
--output_dir=./test_api/src/main/java | ||
|
||
mv ./test_api/src/main/java/pom.xml ./test_api/pom.xml | ||
|
||
# generate_library \ | ||
# --input=./toolresults_v1beta3.json \ | ||
# --language=java \ | ||
# --output_dir=./apis/toolresults | ||
DIR=`dirname "$BASH_SOURCE"` | ||
$DIR/../flank-scripts/bash/flankScripts shell firebase generateJavaClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SET DIR=%~dp0 | ||
%DIR%\..\..\flank-scripts\bash\flankScripts.bat shell firebase updateApiJson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,2 @@ | ||
#!/usr/bin/env bash | ||
|
||
# npm -g install sort-json | ||
|
||
# Note: API discovery JSON is out of date. Check the gcloud CLI repo for most recent JSON. | ||
# https://github.com/bootstraponline/gcloud_cli/blob/master/google-cloud-sdk/lib/googlecloudsdk/third_party/apis/testing_v1.json | ||
|
||
cd json | ||
|
||
TOOL_RESULTS=toolresults_v1beta3.json | ||
rm "$TOOL_RESULTS" | ||
curl -o "$TOOL_RESULTS" https://www.googleapis.com/discovery/v1/apis/toolresults/v1beta3/rest | ||
sort-json "$TOOL_RESULTS" | ||
|
||
TESTING=testing_v1.json | ||
rm "$TESTING" | ||
curl -o "$TESTING" https://www.googleapis.com/discovery/v1/apis/testing/v1/rest | ||
sort-json "$TESTING" | ||
DIR=`dirname "$BASH_SOURCE"` | ||
$DIR/../flank-scripts/bash/flankScripts shell firebase updateApiJson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Rem REPLACE with #1246 | ||
SET DIR=%~dp0 | ||
|
||
SET FLANK_SCRIPTS=%DIR%\.. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
SET DIR=%~dp0 | ||
SET scriptsJar=%DIR%\flankScripts.jar | ||
|
||
if not exist "%scriptsJar%" { | ||
%DIR%\buildFlankScripts.bat | ||
} | ||
|
||
java -jar "%scriptsJar%" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
flank-scripts/src/main/kotlin/flank/scripts/shell/BuildFlank.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package flank.scripts.shell | ||
|
||
import com.github.ajalt.clikt.core.CliktCommand | ||
import flank.scripts.shell.utils.createGradleCommand | ||
import flank.scripts.shell.utils.rootDirectoryPathString | ||
import flank.scripts.utils.runCommand | ||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
import java.nio.file.StandardCopyOption | ||
|
||
object BuildFlankCommand : CliktCommand(name = "buildFlank", help = "Build Flank") { | ||
override fun run() { | ||
buildFlank() | ||
} | ||
} | ||
|
||
private fun buildFlank() { | ||
createGradleCommand( | ||
workingDir = rootDirectoryPathString, | ||
"-p", rootDirectoryPathString, ":test_runner:clean", ":test_runner:assemble", ":test_runner:shadowJar" | ||
) | ||
.runCommand() | ||
|
||
copyFlankOutputFile() | ||
} | ||
|
||
private fun copyFlankOutputFile() { | ||
val flankDirectory = Paths.get(rootDirectoryPathString, "test_runner").toString() | ||
|
||
Files.copy( | ||
Paths.get(flankDirectory, "build", "libs", "flank.jar"), | ||
Paths.get(flankDirectory, "bash", "flank.jar"), | ||
StandardCopyOption.REPLACE_EXISTING | ||
) | ||
} |
33 changes: 33 additions & 0 deletions
33
flank-scripts/src/main/kotlin/flank/scripts/shell/ShellCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package flank.scripts.shell | ||
|
||
import com.github.ajalt.clikt.core.CliktCommand | ||
import com.github.ajalt.clikt.core.subcommands | ||
import flank.scripts.shell.firebase.FirebaseCommand | ||
import flank.scripts.shell.ios.BuildExampleCommand | ||
import flank.scripts.shell.ios.BuildFtlCommand | ||
import flank.scripts.shell.ios.InstallXcPrettyCommand | ||
import flank.scripts.shell.ios.RunFtlLocalCommand | ||
import flank.scripts.shell.ios.SetupIosEnvCommand | ||
import flank.scripts.shell.ios.UniversalFrameworkCommand | ||
import flank.scripts.shell.ops.OpsCommand | ||
import flank.scripts.shell.updatebinaries.UpdateBinariesCommand | ||
|
||
object ShellCommand : CliktCommand(name = "shell", help = "Task for shell commands") { | ||
init { | ||
subcommands( | ||
FirebaseCommand, | ||
BuildExampleCommand, | ||
BuildFtlCommand, | ||
RunFtlLocalCommand, | ||
UniversalFrameworkCommand, | ||
OpsCommand, | ||
UpdateBinariesCommand, | ||
BuildFlankCommand, | ||
InstallXcPrettyCommand, | ||
SetupIosEnvCommand | ||
) | ||
} | ||
|
||
@Suppress("EmptyFunctionBlock") | ||
override fun run() {} | ||
} |
18 changes: 18 additions & 0 deletions
18
flank-scripts/src/main/kotlin/flank/scripts/shell/firebase/FirebaseCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package flank.scripts.shell.firebase | ||
|
||
import com.github.ajalt.clikt.core.CliktCommand | ||
import com.github.ajalt.clikt.core.subcommands | ||
|
||
object FirebaseCommand : CliktCommand(name = "firebase", help = "Contains all firebase commands") { | ||
|
||
init { | ||
subcommands( | ||
UpdateApiJsonCommand, | ||
GenerateJavaClientCommand | ||
) | ||
} | ||
|
||
@Suppress("EmptyFunctionBlock") | ||
override fun run() { | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
flank-scripts/src/main/kotlin/flank/scripts/shell/firebase/GenerateJavaClientCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package flank.scripts.shell.firebase | ||
|
||
import com.github.ajalt.clikt.core.CliktCommand | ||
import flank.scripts.exceptions.ShellCommandException | ||
import flank.scripts.utils.checkIfPipInstalled | ||
import flank.scripts.utils.installClientGeneratorIfNeeded | ||
import flank.scripts.utils.runCommand | ||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
import java.nio.file.StandardCopyOption | ||
|
||
object GenerateJavaClientCommand : CliktCommand(name = "generateJavaClient", help = "Generate Java Client") { | ||
|
||
override fun run() { | ||
checkIfPipInstalled() | ||
installClientGeneratorIfNeeded() | ||
val apiPath = Paths.get("test_api").toString() | ||
val outputDirectory = Paths.get(apiPath, "src", "main", "java").toString() | ||
val testingJsonInput = Paths.get("json", "testing_v1.json").toString() | ||
Paths.get(apiPath, "src").toFile().deleteRecursively() | ||
|
||
val generateLibraryCommand = "generate_library " + | ||
"--input=$testingJsonInput " + | ||
"--language=java " + | ||
"--output_dir=$outputDirectory" | ||
|
||
val result = generateLibraryCommand.runCommand() | ||
if (result != 0) throw ShellCommandException("Error when execute generate_library command") | ||
|
||
Files.move( | ||
Paths.get(outputDirectory, "pom.xml"), | ||
Paths.get(apiPath, "pom.xml"), | ||
StandardCopyOption.REPLACE_EXISTING | ||
) | ||
} | ||
} |
Oops, something went wrong.