-
Notifications
You must be signed in to change notification settings - Fork 914
chore: Made a single scripts for all functions to be run in travis. #2840
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
Conversation
|
This is opposite of what I asked. Do you understand why I asked you to create a script? |
|
Do I have to create a separate script to be run on fdroid? |
|
Why else would I comment it on an issue based on F-Droid release? |
|
This has nothing to do with Travis, however, that single script will run on both travis and fdroid. It will not have unnecessary things like sudo apt install and whatnot. Those utilities are already intalled in the environment |
|
Sorry for misunderstanding it. I'll update this pr accordingly right now. |
|
Simply make a script like this https://github.com/iamareebjamal/opencv-android/blob/master/setup_opencv.sh |
|
Ok. |
|
@iamareebjamal the current script in this pr is alright? I just have to make a separate script using the same code, right? |
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.
looks good to go
No, it is not It depends on Travis. It needs to be run in fdroid as well. See the script I linked which does not have any unnecessary dependency on any environment |
phimpme.sh
Outdated
| @@ -0,0 +1,101 @@ | |||
| language: android | |||
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.
Are you kidding me? What is this?
phimpme.sh
Outdated
| - extra-android-support | ||
| # Latest artifacts in local repository | ||
| - extra-google-m2repository | ||
| - extra-android-m2repository |
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.
looks more like a yml file than a .sh file (bash script)
|
@iamareebjamal @abishekvashok how do I create the android environment in the bash script to run the build? |
|
Just combine the 2 scripts to download and copy OpenCV SDK. It's not rocket science. |
|
|
@iamareebjamal I have a doubt. This new script that is being made, in this, we only download openCV and copy the needed files to their respective destination folders? |
|
YES! |
|
@iamareebjamal ok. But I do not get how is it better than the way we are doing things now. We have to use another script besides travis in either case. |
|
No, you'll use the same single script in both travis and fdroid |
phimpme.sh
Outdated
| @@ -0,0 +1,20 @@ | |||
| mkdir $HOME/openCV/ | |||
| cd $HOME/openCV | |||
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.
You should not use $HOME as told before
phimpme.sh
Outdated
| mkdir $HOME/openCV/ | ||
| cd $HOME/openCV | ||
| mkdir openCV/ | ||
| cd openCV |
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.
Unnecessary
phimpme.sh
Outdated
| mv OpenCV-android-sdk opencv | ||
|
|
||
| cd $TRAVIS_BUILD_DIR | ||
| cd .. |
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.
Unnecessary
phimpme.sh
Outdated
|
|
||
| cd .. | ||
|
|
||
| mkdir phimpme-android/app/src/main/3rdparty |
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.
| mkdir phimpme-android/app/src/main/3rdparty | |
| mkdir app/src/main/3rdparty |
phimpme.sh
Outdated
| mkdir phimpme-android/app/src/main/staticlibs | ||
| mkdir phimpme-android/app/src/main/jni/include | ||
|
|
||
| mv openCV/opencv/sdk/native/3rdparty/* phimpme-android/app/src/main/3rdparty |
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.
| mv openCV/opencv/sdk/native/3rdparty/* phimpme-android/app/src/main/3rdparty | |
| mv openCV/opencv/sdk/native/3rdparty/* app/src/main/3rdparty |
|
@iamareebjamal thanks for the guidance. Is the script fine now? |
.travis.yml
Outdated
|
|
||
| before_script: | ||
| # - ./scripts/download_open_cv.sh | ||
| - ./phimpme.sh |
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.
Rename to setup_opencv.sh and use cache like the script in my link
|
Use version 4.1.1 and like I do in the linked script |
Then we'll have to update the openCV module being used currently too. Should I do that? |
|
@iamareebjamal the script is updated. Please tell me about the openCV version to be used. |
setup_opencv.sh
Outdated
| opencv_version="4.0.1" | ||
| opencv_sdk_zip="cache/opencv-android-sdk.zip" | ||
| download_url="https://github.com/opencv/opencv/releases/download/${opencv_version}/opencv-${opencv_version}-android-sdk.zip" | ||
| mkdir cache/ |
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.
| mkdir cache/ | |
| mkdir -p cache/ |
setup_opencv.sh
Outdated
| opencv_sdk_zip="cache/opencv-android-sdk.zip" | ||
| download_url="https://github.com/opencv/opencv/releases/download/${opencv_version}/opencv-${opencv_version}-android-sdk.zip" | ||
| mkdir cache/ | ||
| wget ${download_url} -O cache/opencv-android-sdk.zip |
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.
Where's -c?
setup_opencv.sh
Outdated
| unzip -qqo ${opencv_sdk_zip} -d opencv_sdk | ||
| mkdir opencv/ | ||
| cp -r opencv_sdk/OpenCV-android-sdk/sdk/* opencv/ | ||
| rm -rf opencv_sdk |
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.
Why these extra unnecessary steps?
|
@iamareebjamal please review. |
setup_opencv.sh
Outdated
| mkdir -p cache/ | ||
| wget ${download_url} -c -O cache/opencv-android-sdk.zip | ||
|
|
||
| unzip -qqo ${opencv_sdk_zip} -d opencv_sdk |
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.
| unzip -qqo ${opencv_sdk_zip} -d opencv_sdk | |
| unzip -qqo ${opencv_sdk_zip} |
setup_opencv.sh
Outdated
| mkdir app/src/main/staticlibs | ||
| mkdir app/src/main/jni/include | ||
|
|
||
| mv opencv_sdk/OpenCV-android-sdk/sdk/native/3rdparty/* app/src/main/3rdparty |
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.
| mv opencv_sdk/OpenCV-android-sdk/sdk/native/3rdparty/* app/src/main/3rdparty | |
| mv OpenCV-android-sdk/sdk/native/3rdparty/* app/src/main/3rdparty |
As it was before without any extra useless folders
|
Add cache folder to travis cache |
|
Also, move the script to scripts folder where it belongs with the rest of the scripts |
Fixes #2841
Made a single scripts for all functions to be run in travis.