-
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.
Browse files
Browse the repository at this point in the history
#1345 - iOS Tests artifacts cleanup Changes: * renamed some variables inside flankScripts/ios * added scripts for generating IPA file instead of .xctestrun for gameloop example * reorganised test artefacts (removed unused files, moved them to correct directories * renamed *FlankMultiTestTargetsExample* to *FlankTestPlansExample* // CC: @jan-gogo * changed all references to old test artefacts * rebuilded EarlGrey example with compatible Xcode version Previously: <img width="1046" alt="Screenshot 2020-11-25 at 13 36 07" src="https://user-images.githubusercontent.com/31246956/100228584-2f5e4480-2f23-11eb-9292-112335fd3db1.png"> Now: <img width="1009" alt="Screenshot 2020-11-25 at 13 28 07" src="https://user-images.githubusercontent.com/31246956/100228420-f1f9b700-2f22-11eb-95db-b9291d83cc38.png"> ## Test Plan > How do we know the code works? 1. If you want to easily notice that artifact generation is working correctly you can clear your linked local `test_artifacts` directory. 1. Run `flankScripts shell ops ios`, this command should generate all ios artifacts one by one, and copy each to local `test_artifacts` dir. 1. Make sure the console log doesn't show any error. 1. Make sure the `test_artifacts` directory is containing the following directories: [ EarlGreyExample, FlankExample, FlankGameLoopExample, FlankTestPlansExample ] 1. Run tests manually on each ios project and make sure the results are the same as expected (This step should be widely detailed and updated!!!). ## Checklist - [x] Documented - [x] Unit tested
- Loading branch information
Showing
61 changed files
with
460 additions
and
1,146 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
*.iml | ||
.idea/ | ||
build/ | ||
Build/ | ||
out/ | ||
.DS_Store | ||
.gradle/ | ||
|
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
# Package Files # | ||
flankScripts.jar | ||
flank-scripts.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
|
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
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
34 changes: 33 additions & 1 deletion
34
flank-scripts/src/main/kotlin/flank/scripts/shell/ios/IosBuildCommand.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 |
---|---|---|
@@ -1,10 +1,42 @@ | ||
package flank.scripts.shell.ios | ||
|
||
fun createIosBuildCommand(buildDir: String, workspace: String, scheme: String, project: String = "") = | ||
fun createXcodeBuildForTestingCommand( | ||
buildDir: String, | ||
scheme: String, | ||
project: String = "", | ||
workspace: String = "", | ||
useLegacyBuildSystem: Boolean | ||
) = | ||
"xcodebuild build-for-testing" + | ||
" -allowProvisioningUpdates" + | ||
(if (workspace.isBlank()) "" else " -workspace $workspace") + | ||
(if (project.isBlank()) "" else " -project $project") + | ||
" -scheme $scheme" + | ||
(if (useLegacyBuildSystem) " -UseModernBuildSystem=NO" else "") + | ||
" -derivedDataPath $buildDir" + | ||
" -sdk iphoneos" | ||
|
||
fun createXcodeArchiveCommand( | ||
archivePath: String, | ||
scheme: String, | ||
project: String = "", | ||
workspace: String = "" | ||
) = | ||
"xcodebuild" + | ||
" -allowProvisioningUpdates" + | ||
(if (workspace.isBlank()) "" else " -workspace $workspace") + | ||
(if (project.isBlank()) "" else " -project $project") + | ||
" -scheme $scheme" + | ||
" archive" + | ||
" -archivePath $archivePath" | ||
|
||
fun createXcodeExportArchiveCommand( | ||
archivePath: String, | ||
exportOptionsPlistPath: String, | ||
exportPath: String = "" | ||
) = | ||
"xcodebuild -exportArchive" + | ||
" -allowProvisioningUpdates" + | ||
" -archivePath $archivePath" + | ||
" -exportOptionsPlist $exportOptionsPlistPath" + | ||
" -exportPath $exportPath" |
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/ops/BuildGameLoopExampleCommand.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.ops | ||
|
||
import com.github.ajalt.clikt.core.CliktCommand | ||
import com.github.ajalt.clikt.parameters.options.flag | ||
import com.github.ajalt.clikt.parameters.options.option | ||
import flank.scripts.shell.utils.failIfWindows | ||
import flank.scripts.shell.utils.iOSTestProjectsPath | ||
import java.nio.file.Paths | ||
|
||
object BuildGameLoopExampleCommand : CliktCommand( | ||
name = "build_ios_gameloop_example", | ||
help = "Build ios game loop example app" | ||
) { | ||
|
||
private val generate: Boolean? by option(help = "Make build").flag("-g", default = true) | ||
|
||
private val copy: Boolean? by option(help = "Copy output files to tmp").flag("-c", default = true) | ||
|
||
override fun run() { | ||
failIfWindows() | ||
|
||
IosBuildConfiguration( | ||
projectPath = Paths.get(iOSTestProjectsPath, FLANK_GAME_LOOP_EXAMPLE).toString(), | ||
projectName = FLANK_GAME_LOOP_EXAMPLE, | ||
buildConfigurations = listOf( | ||
IosTestBuildConfiguration(FLANK_GAME_LOOP_EXAMPLE, "tests"), | ||
), | ||
useWorkspace = false, | ||
generate = generate ?: true, | ||
copy = copy ?: true | ||
).generateIPA() | ||
} | ||
} | ||
|
||
private const val FLANK_GAME_LOOP_EXAMPLE = "FlankGameLoopExample" |
Oops, something went wrong.