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
[Feature]: F-Droid #545
Comments
I'll publish it soon. But this is a duplicate of #419. |
Sorry, please forgive me |
the issue "#419" is not found . is there an updated link? |
Is there any progress? |
I've tried to publish AndroidIDE to F-Droid multiple times, but it always fails to determine the version of AndroidIDE from the source code. However, we might consider creating a custom F-Droid repository which can be used to publish AndroidIDE. After that, you'll be able to add that repository to the F-Droid client. |
Could you paste out your f-droid-data .yml build file? Maybe I or someone else can help. :) |
Unfortunately, I don't have the files now. Sorry. However, the "fastlane" directory in the repository contains some basic information about the project which you can use to create the metadata if you want. Edit: |
|
Not specifically, but it's related. I'm talking about product flavors which are configured for AndroidIDE here.
The version name and version code of AndroidIDE is calculated dynamically, based on the type of commits after the previous Git tag. This is achieved using the Nyx tool. I'm not sure, but I think this might be the cause that the version names are not properly inferred by F-Droid. |
This is supported but F-Droid requires different version codes for different abis.
The version name and version code can be overrided manully anyway. But for auto update we need to get it from somewhere. E.g., you can put a text file in besides the apk in github release with the version name and version code. |
For this, I suppose we can present a number to the existing version code for each product flavor. For example version code
If we just need to write the version name and version code of the APK to a file, then yes, we can do that. I still need more information about this. Is it possible for you to contact me on telegram? Or via email (see my profile for the address)? I'll reopen this issue as #419 has been deleted for some reason. |
We support extending the version code with 1 so it becomes 2701.
I don't use telegram. I thought it's easier to discuss here but I can send you an email if you prefer that. :) |
It's okay, we can discuss here.
Can you point me to the documentation where these things are mentioned (if there are any)? I can try to submit again with the new information. |
There is not too much document about this (maybe I should write some about this). Basically everything is in https://f-droid.org/docs/Build_Metadata_Reference/. You can change the source code in |
Hey @linsui, Is there a way make
This repository is required for the Gradle Tooling API which we use to run Gradle tasks in the IDE. Here is the metadata file Categories:
- Development
License: GPL-3.0-only
WebSite: https://androidide.com
SourceCode: https://github.com/AndroidIDEOfficial/AndroidIDE
IssueTracker: https://github.com/AndroidIDEOfficial/AndroidIDE/issues
Translation: https://crowdin.com/project/androidide
Changelog: https://github.com/AndroidIDEOfficial/AndroidIDE/releases
Donate: https://androidide.com/donate/
AutoName: AndroidIDE
RepoType: git
Repo: https://github.com/AndroidIDEOfficial/AndroidIDE
Builds:
- versionName: v2.6.1-beta
versionCode: 261
commit: 83a33ac3ee4bc03cd41a0f07d059f54adad5862e
subdir: app
sudo:
- apt-get update
- apt-get install -y openjdk-17-jdk-headless
- update-java-alternatives --jre-headless -a
init: chmod +x ../scripts/setup_fdroid_build.sh && ../scripts/setup_fdroid_build.sh $$VERSION$$ $$VERCODE$$
gradle:
- arm64-v8a
- armeabi-v7a
- x86_64
scanignore:
- build-logic/
- testing/resources/
- app/src/main/assets/data/common/android.jar
- app/src/main/assets/data/common/gradle-wrapper.zip
- app/src/arm64-v8a/assets/data/arm64-v8a/aapt2
- app/src/armeabi-v7a/assets/data/armeabi-v7a/aapt2
- app/src/x86_64/assets/data/x86_64/aapt2
- subprojects/framework-stubs/libs/android.jar
- termux/termux-app/src/main/cpp/bootstrap-*.zip
gradleprops:
- ide.build.fdroid=true
AutoUpdateMode: Version +-fdroid %v
UpdateCheckMode: HTTP
VercodeOperation:
- 100 * %c + 1
- 100 * %c + 2
- 100 * %c + 3
UpdateCheckData: https://androidide.com/functions/fdroid-version-check.php|versionCode=(.*)|.|versionName=v(.*) I haven't been able to perform the actual build yet, because of the repository error. I looked into the build metadata reference, but it doesn't seem to contain any information related to this issue (or at least I didn't find anything). |
We shouldn't ignore it. But you can use scanignore to ignore the file. Generally we should build those files in scanignore from source. |
You can only build 1 apk in 1 build block. So you need to add 3 build blocks with different flavor, version name and version code. |
How do you get the aapt2 binary? They are packaged in google maven repo. We can use that. |
When building with fdroidserver, it complains about
Thanks, I'll add Build blocks for each flavor. For new updates, do I need to update these Build blocks manually?
We actually build it from source here. The one published on Google Maven Repo is not usable on Android (as it is built for Linux x86_64). |
This can be added to scandelete.
They can be auto updated. You can add a list in VercodeOperation.
Oh, that's good. Then we can build them from source. |
Is the existing VercodeOperation correct? We have 3 flavors named after supported ABIs
Well, if we build the platform tools along with AndroidIDE, it would increase repository's size a lot. Building I can use Termux's approach of handling these things (for aapt2 as well as bootstrap packages). They build and publish the bootstrap packages in the |
That's correct.
I thought this should be good. It's always better to build it from source but it maybe too difficult. We can have a try later. 1 GB is not a big problem for F-Droid. You can add it in a submodule or we can handle it with srclibs. |
Thanks!
I meant that it could be a problem for people trying to build the project locally. Adding it to a module would still be a problem for such cases as everything will be cloned anyway. At the moment, I have no idea how to use |
I'll probably go ahead with the submodules approach for building aapt2 if F-Droid really prefers that, but for the bootstrap packages, I can either keep them in Do you think we can publish this to FDroid as it is now, then work on these things after the release is published? I need to ask this because AndroidIDE v2.7.0-beta has been finalized and adding those changes will take some time to implement properly. |
Then maybe srclibs should be used instead. You need to add your repo in
Building them from source is prefered but difficult. Currently we don't build the Termux binaries, either. I thought it's OK to use the Termux's approach for now.
I thought we still need to test and debug the build metadata. I'm not sure how long it will take but given that Android IDE is a very complicant project I thought it's will take some time to get everything done. So if you are going to publish a new release then maybe you should do that first and we can try to publish the next version. |
Thanks. Will do.
Looking at the existing srclibs and metadata of other applications that use
I'm trying to build the project using fdroidserver so I can verify everything works fine, at least for my local installation. The build works fine as of now (with the binaries included in the source). However, I've configured the version names incorrectly in the metadata, so it's showing some error about expected version names AFTER the build process. I'll try to get everything right so that it won't be a hassle for you guys to review and test the merge request.
I'll publish v2.7.0-beta now and try to publish v2.7.1-beta to FDroid after all these changes. |
The srclib will be cloned into
That's great! Then the only problem is the scanignore. I'm not sure if we should consider those files as "assests". And maybe we should also build the Gradle Tooling API plugin since it's from a maven repo we don't allow or we should allow it since it's from gradle directly (even in the same repo https://github.com/gradle/gradle/tree/master/platforms/ide/tooling-api). Are the android.jar from the sdk directly?
So please open an MR when the metadata is realy, then we can discuss those problem there. |
Got it, thanks!
In my personal opinion, allowing it would be better choice, after checking the repository for problematic libraries of course. However, building that module from source would be difficult since it depends on other modules from Gradle's source. It is also worth noting that the
Yes. I can update the codebase to copy it directly from the current (installed) Android SDK, if FDroid allows that. Or do you have something else in mind? |
Unfortunately Gradle itself is problematic so we need to be careful here... It uses non-free plugin in its codebase. https://github.com/gradle/gradle/blob/master/settings.gradle.kts#L12
Then we just need to add them to scandelete and copy them from installed SDK in |
I did some tests, and it looks like we can configure a repository but only use it for a specific module. Example : dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven {
url = uri("https://repo.gradle.org/gradle/libs-releases/")
content {
includeModule("org.gradle", "gradle-tooling-api")
}
}
}
} If this defined, it seems like Gradle will use it to only resolve that dependency. So, if you define another dependency that is published on the same repository :
the build fails with the following error :
However, updating I don't know if this is something FDroid can accept, but it's worth considering for our issue at least. |
@linsui As Gradle is licensed under Apache License 2.0, I can try to re-publish the |
A workground but totally OK. 😂 For items in scanignore:
It seems the tooling-api and the wrapper jars are shipped in the gradle binary tarball. Maybe we can simply copy them from there. |
Didn't think of that, but yeah, totally doable. We won't have to publish the module then.
Yes, already working on it. Apart from these, I've been facing some weird issues. For example, with the fdroidserver installation on a server (Ubuntu 22.04, DigitalOcean Droplet), when building the application (or when Also, when building the platform tools on the server, the The commands for building cd $$android-ide-platform-tools$$
# Set CMake version
cmake_version=3.28.1
cmake_name=cmake-$cmake_version-linux-x86_64
# Download CMake
wget https://github.com/Kitware/CMake/releases/download/v$cmake_version/$cmake_name.tar.gz
tar xf $cmake_name.tar.gz
# Get source files
python3 get_source.py --tag=platform-tools-34.0.4
# Patch source files
find patches -name "*.patch" -exec git apply {} \;
# Build protobuf
cd src/protobuf
ln -sf $(realpath ../googletest) third_party/googletest
cmake -GNinja -Dprotobuf_BUILD_TESTS=OFF
ninja -j$(nproc --all)
cd -
# Build aapt2
ln -sf $(realpath ./src/googletest/googletest) ./src/boringssl/src/third_party/googletest
./build.py \
--ndk=/build/\$ANDROID_HOME/ndk/26.1.10909125 \ # Had to hardcode this, due to previously mentioned error.
--build=$(pwd)/build \
--api=34 \
--abi=arm64-v8a \
--protoc=$(pwd)/src/protobuf/protoc \
--cmake=$cmake_name/bin/cmake \
--target=aapt2 Is it okay to download CMake like that? |
You can build cmake from source. See https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/is.xyz.vcmi.yml#L768 for example. :) |
Okay. |
So finally, the metadata is complete now. The GitLab Pipelline build failed, because "execution took longer than 1h0m0s seconds". However, the build for I'll create the merge request on GitLab now so you can review. |
That's great! |
A merge request has been opened. |
The merge request has been merged and AndroidIDE should be available on F-Droid soon! |
It has been published. :) The website will be updated soon. You can add this somewhere.
|
Thanks! |
Feature description
This is a suggestion more than a request: you could distribute AndroidIDE on F-Droid.
What version of AndroidIDE you're using?
v2.1.1
Duplicate issues
Code of Conduct
The text was updated successfully, but these errors were encountered: