I want to generate one jar per sub-package using an ant build script on a project looking like this :
basepackage
|__ subpackage1
| |_ Class11
| |_ Class12
|
|__ subackage2
|_ Class21
|_ Class22
...
So I have a target makejar that should build the jar from a given fileset and a target makeAll responsible for making all the filesets and calling the makejar target in these. The problem is that I don't understand how to build one fileset for each subpackage and how to transfer these filesets to the makejar target.
Is it the good way to do this or should I use an other tool ?
I'd prefer don't using user inputs and parse the directory structure automately.
I've seen a lot of answers talking about antcontrib but I don't know if it will solve my problems.
Related
I was recently asked to contribute in a latex project which is already relatively large. The main project is in one folder lets call it "project". There ist also another folder called "style", which includes some .cls files and some images.
I already found out, how to download submodules recursively via git and now I have a project structure like this:
parent_folder
|
+- project
|
+- project.tex
+- style
|
+- stylesheet.cls
In project, there is a file project.tex which uses stylesheet.cls like this:
\documentclass[a4paper,11pt]{stylesheet}
When I try to compile project.tex I get an error:
Missing input file: 'stylesheet.cls'
I tried using \documentclass[a4paper,11pt]{style/stylesheet}, but the same error occures.
Has anybody an idea how to fix this, whithout changing the whole project structure?
Is there something like a latex-makefile? I'm quite new to latex, sorry if I'm asking stupid questions...
I can't seem to figure out how to use the basic archive artifacts statement. What I want is to archive an entire subtree but naming it doesn't seem to work. Nor does directory/** nor directory/**/
I've read the ant doc but it doesn't make much sense to me.
How do I specify a subtree? Or... where can I find a meaningful description of whatever goes in that field?
Directory/**/*.* -> All the files recursively under Directory
**/*.* -> all the files in the workspace
**/*.xml -> all xml files in your workspace.
Directory/**/*.xml -> All the xml files recursively under Directory
We are using TFS 2010, and we have some very annoying trouble with our dependency/branch management.
At first glance, our problem is quite common. We have AppServer, WebClient and WinClient. Both WebClient and WinClient depend on AppServer. There are two additional limitations:
we prefer to include specific version of used dependency
we prefer to include source code and not binaries, because it's easier to implement and test AppServer changes coming from specific origin, for example, WinClient.
We choose following folder structure:
\
|-AppServer (1)
|-WebClient
|-Dependencies
|-AppServer (2)
|-Sources
|-WinClient
|-Dependencies
|-AppServer (3)
|-Sources
AppServers (2) and (3) are branches (as first-class branch) of AppServer (1). It all works pretty well and matches our development scenario.
Now, there comes a trouble. Suppose we want to implement "branch-per-release" pattern on WebClient, which implies branching whole WebClient hierarchy into another place. We can't do that because TFS2010 does not allow nested first class branches.
To add to the challenge, we envision branch hierarchy (only for WebClient, and we have several other dependent and dependency projects) to be something like this:
WebClient
|-Client1
| |-feature-1
| |-feature-2
| |-v1 Release
| | |-v1 hotfix1
| | |-v1 hotfix2
| |-v2 Release
| |-v1 hotfix1
| |-v1 hotfix2
|
|-Client2
|-feature-1
|-feature-2
|-v1 Release
| |-v1 hotfix1
| |-v1 hotfix2
|-v2 Release
|-v1 hotfix1
|-v1 hotfix2
What are our options? I can think of several:
Convert first-class branches to folders. That will allow us to nest branches, but we will lose tracking and visualization, which I don't like.
We can somehow restructure our code with regards to dependencies. But I tried to think of it for some time and still don't see the answer.
We can switch from code dependencies to binary dependencies, but that will slow our development.
Is there any solution I miss?
Couple of thoughts:
1) You could keep your AppServer Branches separate and un-nested from your WebClients and just use the Workspace Mapping functionality in TFS to emulate something like what you've defined via branching AppServer into the Client branches. This would allow a dev to select the AppServer branch they want and nest it into their local file structure at the right place to facilitate their work.
2) Your statement that development is slowed by having binaries seems like something I would explore further and attempt to measure and quantify. If you have a clear break between your AppServer and the Clients, then I would expect no dependencies between them but instead some proxy code that could be generated by svcutil or some other tool. If this is the case and you are hosting the AppServer in some process and communicating from Clients in another, I don't see why you need to implement your original structure to begin with. It appears to be unnecessary coupling and I would want to know why it was being done in more detail.
I'm working on a sort of 'multi-tenant' grails app that will be used as a 'platform' upon which quick sites will be developed.
A 'site' will include a layout, images, and page gsps.
Right now, these are spread across the project in their normal locations, eg:
/grails-app/views/layout
/grails-app/views/<site>
/web-app/images/
Ideally, they'd all be in one place, centralized by site, like
/sites/<site>/layout
/sites/<site>/pages/
/sites/<site>/imagtes
My current thinking is this could be accomplished with a Build.groovy script and doing some ant trickery at build time.
But I'm not sure if it's possible to do this copying-by-convention - ie I don't know the directories that are present until it runs. (I'm also no ant guru)
Any ideas/suggestions? Thanks!
I have used the following script, named _Events.groovy and located in a scripts folder under your grails application, to copy files before my build:
includeTargets << grailsScript("_GrailsEvents")
eventSetClasspath = { msg ->
println "Custom Configuration"
ant.copy(todir:classesDirPath) {
fileset(dir:"${basedir}/config")
}
}
And I suppose you could use something very similar.
Relevant grails documentation is here
Is it possible to use Ant to copy all the files (not folders) from a hierarchy of folders into one destination folder?
For instance, I have a tree like this:
res
|-images
| |-fg.png
| +-bg.png
+-sounds
+-music.mp3
And I would like a result like this:
data
|-fg.png
|-bg.png
+-music.mp3
The way things are named, filename conflicts are not an issue.
Is this possible to do with Ant?
You can use the flatten attribute of the copy task to accomplish this. You can read more at http://ant.apache.org/manual/Tasks/copy.html.