Android migration Elipse/SVN to Android Studio/GIT project Setting up Gradle We need to setup some local variables (like Asseco artifactory username and password) used in gradle scripts. Open the file C:\Users\<USER>\.gradle\gradle.properties and add this lines: artifactoryUserName=type_your_domain_user_name artifactoryPassword=type_yout_domain_password artifactoryURL=http://arti:8081/artifactory/libs-release-local org.gradle.daemon=true If the file doesn't exists, you need to create it. Setting up project in Android Studio Open android studio and select „Start a new Android Studio project“ C:\Users\<USER>\.gradle\gradle.properties
13
Embed
Android migration Elipse/SVN to Android Studio/GIT · PDF fileAndroid migration Elipse/SVN to Android Studio/GIT project Setting up Gradle We need to setup some local variables (like
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Android migration Elipse/SVN to Android Studio/GITproject
Setting up GradleWe need to setup some local variables (like Asseco artifactory username and password) used in gradle scripts.
Open the file C:\Users\<USER>\.gradle\gradle.properties and add this lines:
If the file doesn't exists, you need to create it.
Setting up project in Android Studio
Open android studio and select „Start a new Android Studio project“
C:\Users\<USER>\.gradle\gradle.properties
Configure new project
Enter “Application name“. This will be subfolder name in folder “Project location“. “Real“ application leave for module name. “Application name”could be the same as name the project name on GIT. (eg. for mZABA-PS, “Application name” could be “ZABAmBankingSME”)
Set “Package name” to “production” package name. This should be “base” package name. Different environment should have package suffix onbase package (eg. base package = “hr.asseco.android.pbz”, test environment package = “hr.asseco.android.pbz.test”).
We want to add application module with “real” application name. This module name will be the part of APK filename. So we need to add newmodule.
Chose application module
Configure new module
Adding activities
Choose not to add activity.
Remove module
We need to remove default module “app”. Select module “app” on the module list and select “-“ to remove it. Confirm it, and close “ProjectStructure” dialog.
Now, we must remove “app” module from the disk drive.
Open “Project” bar (on the left side) and choose “Project” preview from drop down.
Find and select “app” folder and press “Delete”, and confirm the dialog.
Project structure after deleting “app” directory/module.
Now we have the foundation to run ANT scripts (move.xml).
1. 2.
1. 2.
Configuring the ANT scriptFirst copy the ANT script ( ) to the eclipse project folder. Then open the script in Notepad++.move.xml
We need to configure only two parameters:
dest.dir – should be the dir of “application” module (not project dir).package.new – should be production/base package
<project default="convert"> <!-- SRC DIR --> <property name="source.dir" value="." /> <!-- DEST DIR --> <property name="dest.dir" value="C:/Projects/AndroidStudio/PBZmBanking/mPBZ" /> <!-- PROD PACKAGE --> <property name="package.new" value="hr.asseco.android.pbz" />
Runing the scriptTo run conversion script open command prompt, and type:
ant -f move.xml
After the script is finished, the source files will be copied to UTF-8 encoding. Configuration files from “configuration” folder will be distributed inflavors. Each configuration build will have one gradle flavor. There are two exceptions:
“test” – configuration which will be replaced with “atest” flavor,“ide” – this is flavor for developing in Android Studio
Configure Asseco repoOpen the gradle file (build.gradle). It should look like this:project