2016-06-23 17 views
2

私は会社の内部使用のための簡単なアンドロイドアプリケーションを持っています。私は簡単なバージョンのトラッキングを作成したいと思います。 だから、それを実装するために私は私のbuild.gradleファイルにいくつかのコードを追加:versionCodeを現在の日付に設定する

apply plugin: 'com.android.application' 
    buildscript { 
     repositories { 
     jcenter() 
     maven { 
      url "https://plugins.gradle.org/m2/" 
     } 
    } 
    dependencies { 
     classpath "com.github.ben-manes:gradle-versions-plugin:0.12.0" 
     classpath 'org.moallemi.gradle.advanced-build-version:gradle-pugin:1.5.3' 
    } 
apply plugin: 'org.moallemi.advanced-build-version' 
apply plugin: "com.github.ben-manes.versions" 

advancedVersioning { 
    outputOptions { 
     renameOutput true 
     nameFormat '${projectName}-${versionCode}' 
    } 
} 

私がやりたいすべてが(長い)現在の日付にversionCodeを設定することです。 どうすればいいですか?それは正しい方向ですか?

ありがとうございます!

+1

あなたは '$ {プロジェクト名} - ' 'てみました' +システム。 currentTimeMillis(); ? – Blackbelt

答えて

0

あなただけ(モジュール:アプリ)あなたのbuild.gradleにそれを追加versionCodeを設定したい場合は、ファイル:

defaultConfig { 
    versionCode 1 //Set the number you want 
} 
関連する問題