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

chore: Update apk generation and naming convention #2293

Merged
merged 10 commits into from
Jul 12, 2019
Merged

chore: Update apk generation and naming convention #2293

merged 10 commits into from
Jul 12, 2019

Conversation

atm1504
Copy link
Member

@atm1504 atm1504 commented Jul 1, 2019

Fixes #2292

@auto-label auto-label bot added the chore label Jul 1, 2019
@atm1504
Copy link
Member Author

atm1504 commented Jul 1, 2019

@iamareebjamal I tried to fix the issue by going through the previous PRs and the existing code in the open event app. And by going through the blog in fossasia blog.
So, there might be wrong. But I think it would work. Please review accordingly.

@iamareebjamal
Copy link
Member

You don't need to touch anything above, just call rm on unneeded files and change the naming in mv

@atm1504
Copy link
Member Author

atm1504 commented Jul 1, 2019

@iamareebjamal please review it now

exec/apk-gen.sh Outdated
# Remove unwanted apk files
rm app-fdroid-release-unsigned.apk
rm app-playStore-release-unaligned.apk
rm app-playStore-release-unsigned.apk
Copy link
Member

Choose a reason for hiding this comment

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

Need this

exec/apk-gen.sh Outdated
rm app-playStore-release-unaligned.apk
rm app-playStore-release-unsigned.apk
rm susi-ai-master-app-playStore-release-unaligned.apk
rm susi-ai-master-app-playStore-release.apk
Copy link
Member

Choose a reason for hiding this comment

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

Need this

@iamareebjamal
Copy link
Member

Your script will fail. Seems you haven't tested it

@atm1504
Copy link
Member Author

atm1504 commented Jul 1, 2019

Your script will fail. Seems you haven't tested it

@iamareebjamal I tested the script for the fdroid apps (as the local builds are fdroid only), it worked fine. It was able to rename and delete the files also.

exec/apk-gen.sh Outdated
mv susi-ai-master-app-fdroid-release-unsigned.apk susiai-master-unsigned-fdroid.apk
mv susi-ai-master-app-playStore-release-unsigned.apk susiai-master-unsigned.apk
mv app-playStore-release-unsigned.apk susiai-dev-release-unsigned.apk
mv susi-ai-master-app-playStore-release.apk susiai-master-release.apk
Copy link
Member

Choose a reason for hiding this comment

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

Too repetitive, see other scripts how we do it

Copy link
Member Author

Choose a reason for hiding this comment

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

We can do using the loop, but there is an issue. We won't be able to rename it in the way that Mario wants. He gave a list that cannot be renamed using the loop.
I went through the script present in phimpme-android which renames via loop(keeping the end portion completely same, which is different from the one expected here)

Copy link
Member

Choose a reason for hiding this comment

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

What's not possible?

Copy link
Member Author

@atm1504 atm1504 Jul 2, 2019

Choose a reason for hiding this comment

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

In badge-magic renaming of the files are done by passing it through a for loop sentence.
Screenshot 2019-07-02 at 7 14 28 AM

In that case, only the initial part of the name ( like the app name) can be added. But what we want here is that the entire apk to be renamed and the words like playStore, app is removed from the name.

For example instead of app-fdroid-debug.apk we want susiai-dev-debug-fdroid.apk
These are completely different from the actual name. I think it won't be that effective if we try to do it via a loop.

Copy link
Member Author

Choose a reason for hiding this comment

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

The similar renaming has also been done in pslab-android, there also it is done manually because of completely custom naming.

Copy link
Member

Choose a reason for hiding this comment

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

You can still do that. First remove playStore-debug and release and then do renaming. No issue

Copy link
Member Author

Choose a reason for hiding this comment

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

okk, I will do it

exec/apk-gen.sh Outdated
rm fdroidDebug-output.json
rm fdroidRelease-output.json
rm playStoreDebug-output.json
rm playStoreRelease-output.json
Copy link
Member

Choose a reason for hiding this comment

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

No need for rm, just don't copy

@atm1504
Copy link
Member Author

atm1504 commented Jul 2, 2019

@iamareebjamal please review it. It's working (I tested for f-droid version only).

@atm1504
Copy link
Member Author

atm1504 commented Jul 3, 2019

@iamareebjamal please review it.

@iamareebjamal
Copy link
Member

iamareebjamal commented Jul 3, 2019

Make the changes listed here fossasia/open-event-organizer-android#1770

@atm1504
Copy link
Member Author

atm1504 commented Jul 4, 2019

Make the changes listed here fossasia/open-event-organizer-android#1770

@iamareebjamal
I went through the changes that u did there. But I faced an issue while making these changes in susi. There is no travis.yml file. The scripts are executed using the circle.yml file.
What should I do now? Shall I make the following changes in the apk-gen.sh file:
Current status after I removed copying of json files:
\cp -r ../app/build/outputs/apk/fdroid/*/**.apk .
\cp -r ../app/build/outputs/apk/playStore/*/**.apk .

Changes present in fossasia/open-event-organizer-android#1770
find ../app/build/outputs -type f -name '*.apk' -exec cp -v {} . \;
find ../app/build/outputs -type f -name '*.aab' -exec cp -v {} . \;

Please provide your views

@iamareebjamal
Copy link
Member

If you saw the diff, you'll know same thing was present in the script in that repo. That should answer your question

@atm1504
Copy link
Member Author

atm1504 commented Jul 4, 2019

@iamareebjamal please review it.

@atm1504
Copy link
Member Author

atm1504 commented Jul 11, 2019

@iamareebjamal please review it

exec/apk-gen.sh Outdated
# Remove unwanted apk files
rm susiai-dev-fdroid-release-unsigned.apk
rm susiai-dev-release-unaligned.apk
rm susiai-master-release-unaligned.apk
Copy link
Member

Choose a reason for hiding this comment

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

You still haven't seen other scripts

@atm1504
Copy link
Member Author

atm1504 commented Jul 12, 2019

@iamareebjamal please review it. The script is now similar to /scripts/update-apk.sh present in open-event-attendee-android app

@iamareebjamal iamareebjamal merged commit af6bdfd into fossasia:development Jul 12, 2019
@iamareebjamal
Copy link
Member

You made changes from fossasia/open-event-organizer-android#1770 in a single file and ignored all others. Now master build is failing

There's a reason I gave you a reference PR

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.

Update APK generation and follow name conventions
2 participants