Newbie : how to setup my repository-ies
David M. Carr
david at carrclan.us
Tue Nov 6 14:52:01 UTC 2012
On Tue, Nov 6, 2012 at 3:43 AM, Dave S <snidely.too at gmail.com> wrote:
> (see <http://selenic.com/pipermail/mercurial/2012-November/044480.html>)
>
> Maybe there's some confusion over what is being asked here, or the
> Java experts are out of town for the moment.
>
> Is any of your code under source control now, or will that only occur
> as a result of posting to google.code?
>
> Have you had a chance to look at other google.code java examples, to
> see how those other projects have set themselves up? I haven't, so
> take my advice with caution, but I'd start with only putting your
> source files and build scripts under control.
>
> What's in the proj directory? Is that just the compiled files, ready
> to run? Or do you have source there that isn't in the source
> directory?
>
> Sorry not to be more helpful, but maybe we can tease some better
> answers out of the group.
>
> /dps
>
> --
> test signature -- please apply at front gate on Tuesdays only.
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
Is this the folder structure for just the project that you're going to
post on Google Code, or is it a folder structure that contains both
the project you're planning on posting as well as other projects? If
it contains other projects, I recommend creating a new folder
structure, copying in just the portions that you want to post to
Google Code, and testing that it builds. You'd then initialize the
Mercurial repository in the root of this new folder structure.
It looks like the "class" folder in your folder structure may be the
output of the Ant build. That is, class files that result from
compilation of the Java source files, as well as the final JAR file
generated by the build. If that's the case, I recommend NOT including
this folder in Mercurial. Rather, add a line to .hgignore for the
folder, so that "hg status" doesn't consider the build output as
something to possible version control (see "hg help ignore" for more
info). Try completely deleting this folder, and test that your Ant
build still works. Adjust the build.xml to create the directory as
needed. When other users first clone the repository, this directory
likely won't exist for them.
It looks like the "lib" folder in your folder structure may contain
the JARs for other libraries that the project depends on. When
possible, I recommend avoiding storing binary files in Mercurial
repositories. It helps to keep the repositories small and fast.
Also, if people make concurrent changes to a JAR file, there isn't
really an easy way to merge those changes. Since you're currently
using Ant as your build tool, I recommend using Ivy to manage your
dependencies. Basically, you'd create an "ivy.xml" file that declares
what JARs are needed, and then use an Ant task that Ivy provides in
your build.xml file to populate the "lib" folder with those JARs. For
libraries that are available in Maven Central, you normally wouldn't
even need to tell Ivy where to download the files from. If you're
going to have to make major build changes, you could also consider
switching your build over to either Maven, Gradle or some similar tool
which provide more built-in support for dependency management.
If you have built output (JARs, javadoc output, etc.) that's getting
built to the proj/application folders, you can either add these to
.hgignore as well, or change the build so that all build output goes
to a separate build output folder structure. I tend to prefer a
"target" directory, with subdirectories as needed. This makes it
really easy to configure a version control tool to ignore, and also
makes for easy cleaning; just delete the directory.
--
David M. Carr
david at carrclan.us
More information about the Mercurial
mailing list