当前位置:  开发笔记 > Android > 正文

用于构建的流行文件夹结构

如何解决《用于构建的流行文件夹结构》经验,为你挑选了3个好方法。

我想知道在项目中组织构建资产和源代码的流行或最佳方法是什么?



1> JeeBee..:

我有

/src    - source files (test files are within a package 'test' here, or 'test' subpackage of what is being tested)
/lib    - required libraries
/doc    - text documentation and development notes
/build  - where we build (each separate build item within a subfolder here)
/conf   - configurations (each config, production, test, developer, etc gets a folder in here, and when building Jars and Wars the correct set is copied across)
/extras - other stuff
/extras/resources - resources that should be included within generated Jars, e.g., icons

/websites - Web related content and configurations (each website in its own folder here)
/websites/$site/webcontent - All the web content here
/websites/$site/conf - website related configuration files here (instead of /conf)
/websites/$site/build.xml - ANT build script for website that creates a war, etc

(remember you might have an admin site and a public site for a single project, hence the multi-site configuration within a single project, or even site v1 and site v2, etc)

最后,根据项目本身,以及是否使用ANT或Maven,您必须有点灵活.我使用ANT,并将ANT脚本放在/ build中,但它们已经出现在某些项目的其他地方(例如/ sites /中的某些项目).



2> Martin Wickm..:

一般来说:

src/      - source files
src/tests - unit tests
doc/      - documentation
res/      - static resources (textures, locale database, level definitions etc)
build/    - tools needed to build the system
            project specific libraries and compilers
Makefile  - the makefile (make, test, clean etc)



3> Romain Linso..:

由于我只处理Java项目,并且所有这些项目都是"Mavenized",因此我使用Maven定义的约定来实现项目结构.

基本上:

project
  src/main/java        --> source files
  src/main/resources   --> resources files (*.xml, *.properties, etc.)
  src/test/java        --> source files for tests.
  src/test/resources   --> resources files for tests.

推荐阅读
帆侮听我悄悄说星星
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有