ant build issues - ant

I have a build with multiple interlinked dependencies, Several projects have common dependencies that are currently compiled more than once. I think in Ant we can tell it not to re-build something if its already just done it as part of the same task, can anyone please advise

ant's javac task will only compile if the source files are newer than the target files. So that should save you some time.
You can also look into ivy for a bit more formal dependency management.

Like leonm says, the compiler will do the right thing. But that won't stop Ant from rebuilding loads of artifacts. What I'd suggest is:
where you can, make targets have a defined output. So a target that builds a jar file from sources can be skipped if those sources haven't been updated since the jar file was built.
how do you implement this? use the uptodate task to set a property if something is actually up to date.
I'd suggest that any targets that do checks be prefixed with a hyphen so they can't be run on their own
And finally, use the 'unless' attribute of the target element to prevent the target running.

Related

nocache.js not found in Vaadin project

"Requested resource [/VAADIN/widgetsets/AppWidgetset/AppWidgetset.nocache.js] not found.." I get this when I'm including new addons, either from a JAR file or through Maven. Sometimes, if I've added the dependency in Maven, adding the JAR file as well to the build path fixes it, sometimes it's the other way around, other times compiling the widgetset and/or theme fixes it, and there are even times when nothing helps. This type of behavior seems to me more random than scientific.
I would love to know how to properly add dependencies to the project so that I can avoid this problem.
Select the UI project and goto Properties - Deployment Assembly. Check if you already have widgetset.jar file. If the widgetset.jar is missing then Click on Add -> Maven Project and select widgetset (make sure the jar file naming convention follows backend project like WEB-INF/lib/qqq-widgetset-1.0-SNAPSHOT.jar and WEB-INF/lib/qqq-backend-1.0-SNAPSHOT.jar)

Does xcode 7compiles all files upon build action

Do xcode 7 compiles all files upon build action while only few files are modified?
If YES, does XcodeBuild provides any support to customize building process by compiling only modified files ?
Thanks
No. Xcode, by default, will not recompile unchanged files.
You can force a recompile of all files in the target, by first issuing a "clean" command.
Also note that Xcode will only compile files which are members of the current target.
No, Xcode tracks dependencies and only compiles those files that need to be recompiled. If you're working in Objective-C it's a good idea to put your #import statements in your .m files where possible, since it prevents your project from becoming dependent on every single header file. (I don't know as much about how dependencies are determined in Swift.)

How to Ant build with project lombok library?

Has anyone build project (containing project Lombok annotations) with ant build?
I have added lombok.jar in classpath, but still not working.
Possible problems:
You're not actually including the jar file in classpath. Worth checking it twice.
You are including the jar, but annotation processing is off. This
would happen if you're compiling with javac5 or earlier. Use javac6
and make sure there's nothing like -proc:none being passed as
argument.

how to make xcode run a script before dependencies?

Scenario:
I have TargetA, which is an iOS application. This app uses a static library, compiled by TargetB.
Obviously, TargetB is a dependency of TargetA, and TargetB is always built before TargetA. So far so good.
Now, I want a script to run TargetA is built, but even before TargetB.
What I tried:
Adding a "setup" aggregate/external-build target, and making it a dependency of TargetA. It half works: Xcode runs setup and TargetB at the same time, so TargetB may get built too soon. Not good enough.
The same, but specifying in the scheme not to build in parallel. This works, but is a waste, since there are other targets that can be built in parallel.
Run the script in a pre-action build step inside the scheme. This works, but seems wrong (why? output from that step doesn't go into the build log; so perhaps I'm not meant to use it this way?).
What I don't want to do:
Add the script as a dependency of TargetB. This would work; however, TargetB actually comes from another sub-project, and in the context of building it, parameters to the script are not yet known (mainly the root directory of TargetA's project).
Am I missing anything, or do I have to settle for #2 or #3 above?
EDIT: in option #2 above, changing the order of dependencies (in my case, between Setup and TargetB does not help -- Xcode still selects the order arbitrarily.
Running the script as a pre-action build step inside the scheme is the best way to accomplish what you want. A common use of this approach is to adjust the project's build number base on the source control state (example). As far as capturing the script output, unfortunately the only thing you can do is redirect stdout for the script to a log file. That log file could be part of your project, so it would be easy to view from Xcode.

Duplicate package problem

I am trying to integrate Twitter in my application. I import two .jar files with different names, but one package has the same name in both files. When I compile, it shoes following error.
Description Resource Path Location Type
D:\CustomClasses\ksoap2-j2me-core-prev-2.1.2.jar(org/kxml2/io/KXmlParser.class): Error!: Duplicate definition for 'org.kxml2.io.KXmlParser' found in: org.kxml2.io.KXmlParser
Assuming the two JARs are third party (not platform libraries), you should consider a more sophisticated compilation and packaging step. But before going down this path, check to see whether the JARs you are importing don't come in different forms -- ones that don't embed their dependencies.
Either way, have a step in your compilation to extract just the parts that you need from each JAR.
If you are not using build scripts but use an IDE for everything, set up a build script just to build your customized dependencies JAR.

Resources