-
Notifications
You must be signed in to change notification settings - Fork 46
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
Feat: Add task to build experimental engine in android #650
Changes from 3 commits
f032ad6
25822af
492af69
6c43d27
1faff56
03478e2
d8e8bd6
444b869
43f514d
b6a22f6
a4c7020
738e1de
47bcfc3
04ac4ca
c2278a3
c544f21
29d0e56
956ae09
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/oonimkall.aar | ||
/oonimkall-sources.jar |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
configurations.maybeCreate("default") | ||
artifacts.add("default", file('oonimkall.aar')) | ||
|
||
task clean(type: Delete) { | ||
delete 'oonimkall.aar' | ||
delete 'oonimkall-sources.jar' | ||
} | ||
|
||
task buildExperimentalArchive(type: Exec) { | ||
commandLine 'sh', 'mkdir' , '-p' , rootProject.buildDir | ||
commandLine 'sh', "../scripts/build_experimental_archive.sh" , project.property('ooni.experimental.target') , rootProject.buildDir | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ooni.experimental.target=master |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
aanorbel marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be |
||
|
||
# Define build and output directories | ||
gitTarget=${1:-"master"} | ||
buildDir=${2:-"./build"} | ||
|
||
# Create build directory and navigate into it | ||
mkdir -p "${buildDir}" && cd "${buildDir}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need the Also, I'd Evidence:
|
||
|
||
# Clone the repository | ||
git clone -v https://github.com/ooni/probe-cli.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can possibly make this more efficient by using |
||
|
||
# Navigate into the repository | ||
cd probe-cli | ||
|
||
git checkout master | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you only want to clone each time, this line is redundant. Otherwise, I think it's fine to have it, but you would still need to add logic above to handle the case where the repository already exists. |
||
|
||
git pull origin | ||
# Checkout the target branch | ||
git checkout -c "${gitTarget}" | ||
|
||
# Build the probe-cli | ||
make android | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This command has huge requirements in terms of building, but I reckon many of them are probably already satisfied if one is using Android Studio every day. Trying to spell them out, I think they are:
I think most of these preconditions are checked by
This action does not need to run at every pull request, rather I suppose it's fine to run it only for commits that have already been merged into the |
||
|
||
cp -v ./MOBILE/android/oonimkall.aar ../../engine-experimental/ | ||
cp -v ./MOBILE/android/oonimkall-sources.jar ../../engine-experimental/ | ||
|
||
|
||
echo "Done building engine archive." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're using bash specific constructs, and I think we do, I really recommend using
bash
. Especially under Debian-derived systems,/bin/sh
is Debian's Almquist shell and it is not working exactly likebash
.