Skip to content

Conversation

@yashk2000
Copy link
Member

@yashk2000 yashk2000 commented Jul 27, 2019

Fixes #2841

Made a single scripts for all functions to be run in travis.

@yashk2000 yashk2000 requested a review from iamareebjamal July 27, 2019 15:58
@yashk2000 yashk2000 changed the title Made a single scripts for all functions to be run in travis. chore: Made a single scripts for all functions to be run in travis. Jul 27, 2019
@auto-label auto-label bot added the chore label Jul 27, 2019
@iamareebjamal
Copy link
Member

This is opposite of what I asked. Do you understand why I asked you to create a script?

@yashk2000
Copy link
Member Author

Do I have to create a separate script to be run on fdroid?

@iamareebjamal
Copy link
Member

iamareebjamal commented Jul 27, 2019

Why else would I comment it on an issue based on F-Droid release?

@iamareebjamal
Copy link
Member

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

@yashk2000
Copy link
Member Author

Sorry for misunderstanding it. I'll update this pr accordingly right now.

@iamareebjamal
Copy link
Member

@yashk2000
Copy link
Member Author

Ok.

@yashk2000
Copy link
Member Author

@iamareebjamal the current script in this pr is alright? I just have to make a separate script using the same code, right?

abishekvashok
abishekvashok previously approved these changes Jul 27, 2019
Copy link
Member

@abishekvashok abishekvashok left a 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

@iamareebjamal
Copy link
Member

the current script in this pr is alright

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
Copy link
Member

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
Copy link
Member

@abishekvashok abishekvashok Jul 27, 2019

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)

@yashk2000
Copy link
Member Author

@iamareebjamal @abishekvashok how do I create the android environment in the bash script to run the build?

@iamareebjamal
Copy link
Member

Just combine the 2 scripts to download and copy OpenCV SDK. It's not rocket science.

@iamareebjamal
Copy link
Member

Simply make a script like this

iamareebjamal/opencv-android:setup_opencv.sh@master

@yashk2000
Copy link
Member Author

@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?

@iamareebjamal
Copy link
Member

YES!

@yashk2000
Copy link
Member Author

@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.

@iamareebjamal
Copy link
Member

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

the current script in this pr is alright

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

@iamareebjamal
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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 ..
Copy link
Member

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
Copy link
Member

@iamareebjamal iamareebjamal Jul 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mv openCV/opencv/sdk/native/3rdparty/* phimpme-android/app/src/main/3rdparty
mv openCV/opencv/sdk/native/3rdparty/* app/src/main/3rdparty

@yashk2000
Copy link
Member Author

@iamareebjamal thanks for the guidance. Is the script fine now?

.travis.yml Outdated

before_script:
# - ./scripts/download_open_cv.sh
- ./phimpme.sh
Copy link
Member

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

@iamareebjamal
Copy link
Member

Use version 4.1.1 and like I do in the linked script

@yashk2000
Copy link
Member Author

yashk2000 commented Jul 30, 2019

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?

@yashk2000
Copy link
Member Author

@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/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

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
Copy link
Member

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?

@yashk2000
Copy link
Member Author

@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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@iamareebjamal
Copy link
Member

Add cache folder to travis cache

@yashk2000 yashk2000 requested a review from iamareebjamal August 1, 2019 02:59
@iamareebjamal
Copy link
Member

#2840 (comment)

@iamareebjamal
Copy link
Member

Also, move the script to scripts folder where it belongs with the rest of the scripts

@iamareebjamal iamareebjamal merged commit a661dd1 into fossasia:development Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a single script for all functions to be run doing the travis build.

3 participants