Git Product home page Git Product logo

steps-set-android-manifest-versions's Introduction

Set Android Manifest Version Code and Name

Sets the Android Manifest Version Code and Name to the specified value, in the target AndroidManifest.xml file for the next build.

Usage

Android Manifest File Path

This is the direct path to your Adroid manifest .xml file. and should be specified such as: MyFile/Properties/AndroidManifest.xml

Version Code

This is an integer type usually the $BITRISE_BUILD_NUMBER that is used ast the android:versionCode

Version Code Offest

This input will automatically be added to the Build Number as an offset

Version Name

This is a string that will be used to update the android:versionName. It can use any string, but the / is reserved and can not be used. A good example is: 1.0.$BITRISE_BUILD_NUMBER

How to use this Step

Can be run directly with the bitrise CLI, just git clone this repository, cd into it's folder in your Terminal/Command Line and call bitrise run test.

Check the bitrise.yml file for required inputs which have to be added to your .bitrise.secrets.yml file!

steps-set-android-manifest-versions's People

Contributors

birmacher avatar btripp avatar carlossless avatar gregorymartin avatar jamesmontemagno avatar shazbot89 avatar spr-kevinmcmahon avatar viktorbenei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

steps-set-android-manifest-versions's Issues

Could not find current Version Code!

Hey,
Struggling a bit to get builds with updates version codes.

currently i am seeing this

(i) Provided Android Manifest path: Flatify/app/src/main/AndroidManifest.xml
(i) Verson Code: 135
(i) Version Name: 1.0.35
[!] Could not find current Version Code!

do i need to add placeholder version name and codes to the manifest for them to be written over?

Make "Version Name" Optional

Leaving "Version Name" blank should leave not fail this step and instead not touch that setting in the manifest, similar to how the Xcode equivalent of this step works.

Support build.gradle

Would it be possible to add option for adding versioncode and versionname to the gradle file instead?

Fails to complete with branches with slashes ("/") in the name causing Bitrise build failures

Slashes in branch names are a great tool for branch organization.

Here's part of our build output that failed:

(i) Provided Android Manifest path: <some path>
(i) Verson Code: 2822
(i) Version Name: 2.1.2.2822-andre/WOLF-some-branch-name
Version code detected: 3
(i) Version code: 2822
Version name detected: 1.0.3

---- Set Build Version Code:
sed -i.bak "s/android:versionCode="\"${VERSIONCODE}\""/android:versionCode="\"${CONFIG_new_version_code}\""/" ${manifest_file}

---- Set Build Version Code if it was specified:
if ! [ -z "${version_name}" ] ; then
sed -i.bak "s/android:versionName="\"${VERSIONNAME}\""/android:versionName="\"${version_name}\""/" ${manifest_file}
fi
sed: 1: "s/android:versionName=" ...": bad flag in substitute command: 'W'
| |
+---+---------------------------------------------------------------+----------+
| x | [email protected] (exit code: 1) | 5.15 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...jamesmontemagno/steps-set-android-manifest-versions/issues |
| Source: ...://github.com/jamesmontemagno/steps-set-android-manifest-versions |
+---+---------------------------------------------------------------+----------+
...```

Error while apply this step for Android - HockeyApp build

Error:

+------------------------------------------------------------------------------+
| (6) [email protected]                                      |
+------------------------------------------------------------------------------+
| id: set-android-manifest-versions                                            |
| version: 1.0.1                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| time: 2016-02-24T06:06:39-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
 (i) Provided Android Manifest path: agClient.Android/Properties/AndroidManifest.xml
 (i) Verson Code: 26
 (i) Version Name: 1.0.26
FOUND this version name 271
Found this version name <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="agrisyncclient.Dev" android:versionName="1.0.271-DEV" android:versionCode="271">
# ---- Set Build Version Code:
sed -i.bak "s/android:versionCode="\"${VERSIONCODE}\""/android:versionCode="\"${version_code}\""/" ${manifest_file}
# ---- Set Build Version Code:
sed -i.bak "s/android:versionName="\"${VERSIONNAME}\""/android:versionName="\"${version_name}\""/" ${manifest_file}
sed: 1: "s/android:versionName=" ...": unterminated substitute pattern
ERRO[06:06:42] Step ([email protected]) failed, error: (exit status 1) 
|                                                                              |
+----+--------------------------------------------------------------+----------+
| ๐Ÿšซ  | [email protected] (exit code: 1)           | 4.4 sec  |
+----+--------------------------------------------------------------+----------+
| Issue tracker: ...jamesmontemagno/steps-set-android-manifest-versions/issues |
| Source: ...://github.com/jamesmontemagno/steps-set-android-manifest-versions |
+----+--------------------------------------------------------------+----------+


Any help to fix it?

Support build.gradle as input for versioning

Newer Android-projects don't specify the version number any more in the AndroidManifest.xml but in the applications build.gradle file.

It would be great, if there was a similar step, that sets the version number in the build.gradle.

How to prefix with a variable?

It seems something is wrong with this step.
I use a variable:

BASE_VERSION: 1.0

then use

  • set-android-manifest-versions:
    inputs:
    - manifest_file: "$ANDROID_MANIFEST_PATH"
    - version_code_offset: '10000'
    - version_name: $BASE_VERSION.$BITRISE_BUILD_NUMBER

What happens then is that it creates 1.5 (where 5 is the build number) while I would expect 1.0.5

If I change

BASE_VERSION: 1.0.0

Then I get 1.0.0.5 ...

The same happens for the ios step.

Any idea how to get it right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.