Android Project - IDE独立源代码

时间:2015-04-20 23:01:21

标签: git ide gitignore

我想为我的项目创建一个git存储库,而无需添加IDE特定文件。我一直在使用Android Studio,并且我已经创建了一个类似于以下内容的git存储库:

.gitignore
LICENSE.txt
README.md
app/

请注意,应用只有.java和res文件。

我怎样才能尽可能地避免使用特定于IDE的文件(我知道你.gitignore!)以及如何在其他IDE中将其作为新项目导入而没有太多麻烦?

更新:我正在使用gradle来构建它。我也想保留它......

1 个答案:

答案 0 :(得分:0)

所以你想要一个忽略构建系统的临时文件和输出文件的.gitignore

我建议您转到https://gitignore.io,然后生成适合您配置的.gitignore

我使用关键字eclipseandroidgradlehttps://www.gitignore.io/api/android,gradle,eclipse)生成了一个,结果如下:

# Created by https://www.gitignore.io

### Android ###
# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/

# Gradle files
.gradle/
build/
/*/build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

### Android Patch ###
gen-external-apklibs


### Gradle ###
.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar


### Eclipse ###
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# JDT-specific (Eclipse Java Development Tools)
.classpath

# PDT-specific
.buildpath

# sbteclipse plugin
.target

# TeXlipse plugin
.texlipse