Adding apps with Git

Forums General Adding apps with Git

This topic contains 14 replies, has 10 voices, and was last updated by  caarmen 2 years, 6 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #587

    mjw
    Member

    I did finally learn to use git to add applications to the repository. Here is how I did it.

    1) Create an account at gitlab.com and set up git. I found a friendly how to about this on github.
    http://help.github.com/linux-set-up-git/
    Create an SSH key and upload it.
    https://help.github.com/articles/generating-ssh-keys

    2) Got to https://gitlab.com/fdroid/fdroiddata and press “clone”. This creates a child repository where you can apply your changes.

    3) Download your repository (~10mb). Open the Terminal to do so.
    git clone git@gitlab.com:YOUR_USERNAME/fdroiddata.git

    4) Git should now download a folder which is named like your repository to your working directory. That’s the local copy you can work with. Change into that directory and go on with:
    git remote add upstream https://gitlab.com/fdroid/fdroiddata.git
    this creates a link to the official repository to sync with.

    5) Create a file in metadata/ called package.id.txt; there’s a file called template in there for reference. Check that the app builds and that the update check works by running
    fdroid build -v -t -l --no-tarball package.id and fdroid checkupdates package.id respectively. You can find more information about this in the manual.

    6) When you created and changed all the files you wanted to, open the Terminal again and go to your fdroiddata directory. Then do the following
    git add .
    this tells git that all files in the directory should be watched for changes.
    git commit -a
    this adds your changes to your local repository
    git push
    this sends the changes to your gitlab clone

    7) Go back go your repository at gitlab.com and check the changes made. If they are okay, press “request merge” (button at the right) and write a meaningful summary of your changes.
    You can check the status of your merge requests here

    8) Next time you want to change some files, type git pull --rebase upstream master before you start working to download the latest version of the files.


    Updated gitorious urls to the new gitlab urls –@krt

    • This topic was modified 6 years, 1 month ago by  mjw.
    • This topic was modified 4 years, 11 months ago by  mjw.
    • This topic was modified 4 years, 11 months ago by  mjw.
    • This topic was modified 3 years, 3 months ago by  mvdan.
    • This topic was modified 3 years, 3 months ago by  krt.
    • This topic was modified 2 years, 7 months ago by  krt. Reason: update urls
    #720

    tetris4
    Member

    thnx for this guide!

    I think I understand everything about the metadata files except the Version Code one:
    “For example:
    Build Version:0.12,3,651696a49be2cd7db5ce6a2fa8185e31f9a20035
    The above specifies to build version 0.12, which has a version code of 3.”

    Can someone explain what version code is and how to get it?

    eg: am trying to make a metadata file for this application: http://code.google.com/p/anstop/

    #724

    mjw
    Member

    The Version Code can be read from the AndroidManifest.xml file which should be found in the repository of the project. The file specifies details like the permissions a program needs and is needed for releasing the program in the Android Market.

    The Version Code is just an integer that makes clear which version is the most recent one.

    as an example:
    https://code.google.com/p/kiritakikoha/source/browse/AndroidManifest.xml

    #726

    tetris4
    Member

    thnx mjw for the quick response.

    So I will attempt to contribute my first file soon..

    I am trying now to see if I can manage to help on packaging applications for f-droid too.

    If there is any other information about that, other than the README file, do tell.

    thnx again!

    #727

    mjw
    Member

    I don’t think we need any special packaging. F-droid uses .apk files which are the standard way for distributing Android-applications.
    If you manage to add all the necessary build-information, the scripts should be able to create .apk packages from the source code.

    It’s always a great thing to have another helping hand for filling the repository and keeping it updated. Just ask as soon as new problems appear.

    greetings
    m.

    #2326

    mjw
    Member

    I just updated the post to fix some errors and point to the new data repository. Let me know if something is still unclear.

    #2349

    CiaranG
    Moderator

    That’s great, thanks for updating. I made this post sticky.

    #3897

    eldoreez
    Member

    Hello

    I am trying to sync my clone of the repo with ‘master’, but teh following fails:
    liv@liv-laptop:~/Build/f-droid/fdroiddata$ git pull upstream master
    fatal: ‘upstream’ does not appear to be a git repository
    fatal: The remote end hung up unexpectedly

    Am I doing something wrong?

    #3903

    daithib8
    Member

    Use the working with git thread on the development forum. We’ll keep this one short.

    Make sure you have the right url in fdroiddata/.git/config . Not the git@git… ssh url.

    #5406

    qnm
    Member

    Hi,

    Is there a VM I can use to test and debug builds?

    #12384

    AppsDabs
    Member

    Is there any Windows Guide?

    #12387

    krt
    Moderator

    I don’t think so, but tipps recommended. Lot’s of software is packaged for windows, like Python, Git, Android-SDK, build automation tools etc., so it should be only a question of putting it all together. Or you could try cygwin…

    Please note that this guide is quite old and references our old repo, we are now on gitlab, so please check https://gitlab.com/fdroid/fdroiddata/blob/master/CONTRIBUTING.md and post any issues you encounter.

    #12732

    dllud
    Member

    @krt or any other mod,

    Could you please update the OP with the new GitLab links?

    At I replaced the link pointing here to one pointing to the CONTRIBUTING.md.
    As I came here through that old wiki link I blindly followed this guide. Later, when I tried to create a merge request, I realized things had moved to GitLab and I had to repeat the process.

    #12754

    krt
    Moderator

    I updated the links.

    #13386

    caarmen
    Member

    Here are a few issues that I ran into. Hopefully listing these points will help other n00bs like myself to save some time:

    0) Install jdk 8. I had jdk 6 installed, and the signing of the api by fdroid requires java 8 (Maybe java 7 is good enough — I didn’t verify).

    4.1) You also need to clone the fdroidserver repo:

    git clone https://gitlab.com/fdroid/fdroidserver.git

    4.2) Copy the fdroidserver/examples/config.py to fdroiddata/config.py

    4.3) In order to create a signed apk, you need to modify the following in fdroiddata/config.py:

    keystore
    keystorepass
    keypass
    keydname
    keyaliases

    4.4) If you’re on MacOS, it looks like this change is needed due to a different version of ’sed’ (not sure if there’s a more proper solution):

    diff --git a/fdroidserver/common.py b/fdroidserver/common.py
    index 033cba8..1177a8f 100644
    --- a/fdroidserver/common.py
    +++ b/fdroidserver/common.py
    @@ -917,7 +917,7 @@ def remove_debuggable_flags(root_dir):
         for root, dirs, files in os.walk(root_dir):
             if 'AndroidManifest.xml' in files:
                 path = os.path.join(root, 'AndroidManifest.xml')
    -            p = SilentPopen(['sed', '-i', 's/android:debuggable="[^"]*"//g', path])
    +            p = SilentPopen(['sed', '-i', '', 's/android:debuggable="[^"]*"//g', path])
                 if p.returncode != 0:
                     raise BuildException("Failed to remove debuggable flags of %s" % path)

    4.5) Add the path to fdroidserver to your PATH environment variable

    5) The fdroid build command should be run from the fdroiddata directory. This command will create an unsigned apk.

    5.5) To sign the apk:
    fdroid publish -v package.id

    • This reply was modified 2 years, 6 months ago by  caarmen. Reason: Formatting changes
Viewing 15 posts - 1 through 15 (of 15 total)

The forum ‘General’ is closed to new topics and replies.

Posted in