Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircleCI build for PRs #363

Merged
merged 9 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
# For a detailed guide to building and testing on Android, read the docs:
# https://circleci.com/docs/2.0/language-android/ for more details.
version: 2.1

# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
android: circleci/android@1.0.3

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
# Below is the definition of your job to build and test your app, you can rename and customize it as you want.
build:
# These next lines define the Android machine image executor.
# See: https://circleci.com/docs/2.0/executor-types/
executor:
name: android/android-machine

# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
steps:
# Checkout the code as the first step.
- checkout

# And finally run the release build
- run:
name: Build Frameworks
command: scripts/buildPrebidMobile.sh

# Below is the definition of your job to build and test your app, you can rename and customize it as you want.
test:
# These next lines define the Android machine image executor.
# See: https://circleci.com/docs/2.0/executor-types/
executor:
name: android/android-machine

# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
steps:
# Checkout the code as the first step.
- checkout

# And finally run the release build
- run:
name: Test Frameworks
command: scripts/testPrebidMobile.sh

# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
jobs:
- build
- test
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Easily include the Prebid Mobile SDK using Maven. Simply add this line to your g
implementation 'org.prebid:prebid-mobile-sdk:1.12.1'
```


## Build from source

Build Prebid Mobile from source code. After cloning the repo, from the root directory run
Expand Down
14 changes: 8 additions & 6 deletions scripts/buildPrebidMobile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ modules=(
"PrebidMobile-mopubAdapters"
"PrebidMobile-admobAdapters"
)

projectPaths=(
"$BASEDIR/PrebidMobile"
"$BASEDIR/PrebidMobile/PrebidMobile-core"
Expand All @@ -101,7 +102,7 @@ for n in ${!modules[@]}; do
# clean existing build results, exclude test task, and assemble new release build
(./gradlew -i --no-daemon ${modules[$n]}:assembleRelease > $LOGPATH/build.log 2>&1 || die "Build failed, check log in $LOGPATH/build.log" )

# Make folder generated/temp/output
# Make folder generated/temp/output
echoX "Packaging ${modules[$n]}"
mkdir $TEMPDIR
cd $TEMPDIR
Expand Down Expand Up @@ -185,13 +186,14 @@ mkdir $TEMPDIR

cd $TEMPDIR;

unzip -uo $OUTDIR/omsdk.jar
unzip -uo $OUTDIR/PrebidMobile.jar
unzip -uo $OUTDIR/PrebidMobile-core.jar
unzip -uo $OUTDIR/PrebidMobile-rendering.jar
unzip -qq -uo $OUTDIR/omsdk.jar
unzip -qq -uo $OUTDIR/PrebidMobile.jar
unzip -qq -uo $OUTDIR/PrebidMobile-core.jar
unzip -qq -uo $OUTDIR/PrebidMobile-rendering.jar

# unzip second proguard
unzip -B $OUTDIR/PrebidMobile.jar "META-INF/proguard/proguard.pro"
unzip -qq -B $OUTDIR/PrebidMobile.jar "META-INF/proguard/proguard.pro"

# append text from second proguard
cat "$TEMPDIR/META-INF/proguard/proguard.pro~" >> "$TEMPDIR/META-INF/proguard/proguard.pro"
rm "$TEMPDIR/META-INF/proguard/proguard.pro~"
Expand Down