Skip to content

Commit

Permalink
chore: install android dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
phani-srikar committed Jul 15, 2023
1 parent 8c86150 commit 2dd5a41
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 12 deletions.
20 changes: 10 additions & 10 deletions .codebuild/e2e_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ batch:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: build_app_android
buildspec: .codebuild/run_android_modelgen_e2e_test.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: src/__tests__/build-app-android.test.ts
CLI_REGION: us-east-2
debug-session: true
depend-on:
- publish_to_local_registry
# - identifier: build_app_swift
# buildspec: .codebuild/run_ios_modelgen_e2e_test.yml
# env:
Expand Down Expand Up @@ -112,16 +122,6 @@ batch:
# CLI_REGION: ap-southeast-2
# depend-on:
# - publish_to_local_registry
- identifier: build_app_android
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: src/__tests__/build-app-android.test.ts
CLI_REGION: ap-northeast-1
debug-session: true
depend-on:
- publish_to_local_registry
# - identifier: cleanup_e2e_resources
# buildspec: .codebuild/cleanup_e2e_resources.yml
# env:
Expand Down
33 changes: 33 additions & 0 deletions .codebuild/run_android_modelgen_e2e_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 0.2
env:
shell: bash
variables:
AMPLIFY_DIR: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin
AMPLIFY_PATH: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin/amplify
CI: true
CODEBUILD: true
NODE_OPTIONS: --max-old-space-size=8096

phases:
install:
commands:
- sudo apt update
- yes | sudo apt install android-sdk
- export ANDROID_HOME=/usr/lib/android-sdk
- sudo apt install sdkmanager
- yes | sudo sdkmanager --licenses
- codebuild-breakpoint

build:
commands:
- source ./shared-scripts.sh && _runE2ETestsLinux
- codebuild-breakpoint
post_build:
commands:
- aws sts get-caller-identity
- source ./shared-scripts.sh && _scanArtifacts

artifacts:
files:
- $CODEBUILD_SRC_DIR/packages/amplify-codegen-e2e-tests/amplify-e2e-reports/*
discard-paths: yes
2 changes: 1 addition & 1 deletion packages/amplify-codegen-e2e-core/src/init/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function androidBuild(cwd: string, settings: Object = {}): Promise<void>
return new Promise((resolve, reject) => {
const s = { ...defaultSettings, ...settings };

const chain = spawn('gradle', ['build'], {
const chain = spawn('gradlew', ['build'], {
cwd,
stripColors: true,
disableCIDetection: s.disableCIDetection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('build app - Android', () => {
const schemaText = `input AMPLIFY { globalAuthRule: AuthRule = { allow: public } }\n${schema.sdl}`;
updateApiSchemaWithText(projectRoot, apiName, schemaText);
await generateModels(projectRoot);
// await androidBuild(projectRoot, { ...config });
await androidBuild(projectRoot, { ...config });
};
if (skip.has(schemaName)) {
it.skip(testName, testFunction);
Expand Down

0 comments on commit 2dd5a41

Please sign in to comment.