Ivy publish to repository doesn't update local cache - hudson

Given:
Building using Hudson/Ant.
Ivy cache timeout is set to 5 min.
Ivy repository contains has Project A version 2.2.2 and Project B version 1.1.1.
Project B relies on Project A.
Events:
API change is made to Project A.
Related changes are made to Project B.
Project A version 2.2.3 is built and published to the repository.
Under 5 minutes later, Project B version 1.1.2 is built.
Project B fails, still pulling in Project A version 2.2.2 from the Ivy Cache.
After 5 minutes, Project B will build correctly, with Project A version 2.2.3
I've looked but don't see an obvious solution (except not caching?). Is there a setting on publish that will update the local cache and the repo? Do you need to explicitly publish to both?

Just speculation: if A and B are built on the same machine, would doing an <ivy:resolve refresh="true"> at the end of A's build refresh the cache? That doesn't help if A and B build on separate machines, of course...

One solution, similar to (but not as bad as) not caching is to decrease the time things live in the cache via setting the following ivy property:
ivy.cache.ttl.default = 30s
Maybe that would fix your problem, for now. Although, it's not much better than not caching.
Off the top of my head, another thing I might try is to turn off caching but then re-implement caching manually by creating a filesystem resolver in your ivy settings file that points to the cache and placing it lower on the chain. That would look something like this:
<ivysettings>
<settings defaultResolver="all-repositories" />
<include file="ivysettings-common.xml" />
<resolvers>
<chain name="all-repositories" returnFirst="true" >
...
<ibiblio name="ibiblio" m2compatible="true" />
<filesystem name="manual-cache">
<ivy pattern="${ivy.default.ivy.user.dir}/cache/${ivy.local.default.ivy.pattern}" />
<artifact pattern="${ivy.default.ivy.user.dir}/cache/${ivy.local.default.artifact.pattern}" />
</filesystem>
...
</chain>
</resolvers>
</ivysettings>
Note: that ivy.default.ivy.user.dir, ivy.local.default.ivy.pattern and ivy.local.default.artifact.pattern are built-in properties that are set by default. I'm referencing them here in this example but I wouldn't need to make any other special effort to set them (they contain proper default values, already).
I hope one of these approaches can address your issue. Those are the only two possible solutions that come to mind, right now.

In the ivy file of project B you need to set the changing attribute to true on the dependency.
<dependency org="org.example" name="A" revision="latest.integration" changing="true" />
See the ivy documentation

Related

Monodevelop fails to build, can't find Microsoft.DiaSymReader.Native.x86.dll'

I am trying to build a web api project using monodevelop on a mac. The thing is that after a few hiccups (explained in a question that turned out to be so messy I have just deleted) I get to the point of getting this error
/Users/myuser/git/LiveData/LiveData/CSC: Error CS0041: Unexpected error writing debug information -- 'Windows PDB writer is not available -- could not find Microsoft.DiaSymReader.Native.x86.dll' (CS0041) (LiveData)
In a windows machine the same project builds using visual studio targeting mono 4.5.
When I click on the error it tells me that /Users/myuser/git/LiveData/LiveData/CSC doesn't exist
Another thing is that in the folder structure of the solution there's a package folder (not the one inside the project) and inside this one I have a folder called Microsoft.Net.Compilers 1.3.2 that has inside another folder called "tools" that contains among other things csc.exe and the dll thta can't be found.
I have tried to install the dll directly in the project using nuget but even if it was installed the build showed me the same error
Thanks,
As for workaround for now you can just limit usage of Microsoft.Net.Compilers to Release configuration (edit *.csproj file):
<Import Project="..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props" Condition="'$(Configuration)' == 'Release' And Exists('..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" />
take a look at beginning of condition:
'$(Configuration)' == 'Release'
This way I can build and debug locally and build my project ie. in appharbor.
Building the project in release configuration should fix it!
This might not be completely related but may be helpful in some ways. Regarding the issue on 'could not find Microsoft.DiaSymReader.Native.x86.dll', have a look at this issue on GitHub: https://github.com/dotnet/cli/issues/3016
It seems like the solution is either:
Dependency to Microsoft.NETCore.Platforms needed for RID graph which
was missing. Any package which has transitive dependency on it (like
NETStandard.Library) could also make things work.
Adding dependency to "Microsoft.NETCore.Platforms": "1.0.1-" or
"NETStandard.Library":"1.5.0-" make it work.
adding Microsoft.NETCore.Platforms works as well

Azure Worker Role configuration issue while using SlowCheetah with custom config

We are using Nlog as logging tool with our Worker Role of Azure app.
It requires NLog.config file. We installed "SlowCheetah - XML Transforms", and have two Debug/Release transforms).
Solution does get rebuild successfully.
But when I try to run, I am getting following error. (I used exact transformation for nolog.config in one of my Windows service app, and it is working fine there).
Error 163 The item "bin\Debug\NLog.config" in item list "OutputGroups"
does not define a value for metadata "TargetPath". In order to use
this metadata, either qualify it by specifying
%(OutputGroups.TargetPath), or ensure that all items in this list
define a value for this metadata. C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure
Tools\1.6\Microsoft.WindowsAzure.targets 2299 5 Insight.CloudWeb
I don't know if this is done by the SlowCheetah extension, but could you verify if your *.csproj file contains the AfterCompile target similar to this?
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<UsingTask TaskName="TransformXml"
AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
<Target Name="AfterCompile" Condition="exists(’app.$(Configuration).config’)">
<TransformXml Source="NLog.config"
Destination="$(IntermediateOutputPath)$(TargetFileName).config"
Transform="NLog.$(Configuration).config" />
<ItemGroup>
<AppConfigWithTargetPath Remove="NLog.config"/>
<AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
<TargetPath>$(TargetFileName).config</TargetPath>
</AppConfigWithTargetPath>
</ItemGroup>
</Target>
Take a look at Oleg's blog post .Config File Transformation under App.config File Transformation for more information.
I have a fix for this. Now you should be able to transform app.config as well as other XML files for Azure Worker Roles using SlowCheetah. Once I get the fix verified I will release the update to the VS gallery.
If you would like to try the fix you can download the updated VSIX at https://dl.dropbox.com/u/40134810/SlowCheetah/issue-44/SlowCheetah-issue-44.zip. If you are interested in following up on this please use the issue #44.

Converting CruiseControl from CVS to Mercurial

We have an existing cc configuration that was setup by someone before I got here.
We've converted our repository from cvs to mercurial stored on bitbucket.
Everything in my question below is basically just wondering, where do I point to the bitbucket repository in my setup to check for changes? And information about my specific setup.
Looking at how the cvs projects were set up, we have a config.xml and a projectbuild.xml file that contain information about the repository.
I've found the documentation for tag options for the config.xml here :
http://cruisecontrol.sourceforge.net/main/configxml.html
but I'm not sure where I can actually look at the bitbucket repository to check for changes. I assume this would be in the projectbuild.xml file, but I'm not sure what the tag options would be for mercurial. I'm more than happy to be pointed toward some documentation, all I've been able to find is stuff on the config.xml.
Here is part of my config.xml and my projectbuild, or build-tnl-default.xml file as it's called for my specific case:
config.xml (Notice I don't have bootstrappers in this file, I've seen this in other examples and am not sure if this would help me.
<modificationset quietperiod="900">
<mercurial localworkingcopy="projects/${project.name}">
</modificationset>
<schedule interval="100">
<ant anthome="C:\usr\local\apache-ant"
antworkingdir="projects/${project.name}"
buildfile="build-tnl-default.xml"
uselogger="true"
usedebug="false"
propertyfile="C:\usr\local\ia\build.properties"/>
</schedule>
build-tnl-default.xml:
<project name="build-tnl-default"
default="build">
<target name="build">
<!-- Get the latest from mercurial -->
<mercurial>
<!-- Call the target that does everything -->
<ant antfile="build.xml" dir="tnl" target="all"/>
</target>
</project>
Here I have no idea what options are available to me in the mercurial tag. I assume I just need to point this to the repository on bitbucket? In the previous version, it looked like this was pointing to the cvs repository here. I'm just not sure what the mercurial attributes are.
I'm sorry about my newness with this stuff, I might require a little more explanation than many other users. Any help is appreciated. Thanks
You check for updates in your repository (regardless whereever it is hosted) via
<modificationset quietperiod="900">
<mercurial localworkingcopy="projects/${project.name}">
</modificationset>
These tags say, that you query the repository you've checked out under projects/${project.name} and that a build is triggered if within a time frame of 15 minutes (900 seconds) no further changes occured. (I think that 15 minutes is a bit much, btw)
Simply make sure that projects/${project.name} is a Mercurial project that was checked out via hg clone http://repositoryAtBitbucketAsAnExample projects/${project.name} (make sure to expand ${project.name}).
I did not fully understand what build-tnl-default.xml is supposed to do, but if it should grab the newest build.xml, you should think about doing it with an Execootstrapper running something like hg pull ${path.to}/build.xml.
I have no idea what options are available to me in the mercurial tag.
You should determine the <taskdef .../> is used that loads the mercurial tag. This should be somewhere in build-tnl-default.xml or a file that is imported by it.

how to get changed files from TFS using nant

It is really painfull to get all code form TFS whenever you make a build using NANT.
Is there any settings in ccnet.config which will only take the files which are changed form last time which can speed up the process.
The "get" process will only actually download files that are different than the version in the workspace, unless you are specifying a /force which will force it to get the specified version even if TFS thinks it has that version in the workspace.

Is it possible to browse the source of OpenJDK online?

Is it possible to browse the source code of OpenJDK online, just like I can do with SourceForge's projects? I never used Mercury before, so I felt confused.
(Note: I don't want to download the source. I just want to browse it online, to see how some methods are implemented.)
OpenJDK is now on GitHub: https://github.com/openjdk/jdk
It is a large project, but you will find the implementations of the core classes under jdk/src/java.base/share/classes.
For instance you can find the implementation of java.util.List here.
If you need to browse older versions, you still need to use the old Mercurial interface.
The Mercurial interface there is quite confusing if you are not used to it, and since this is a large project, it can be hard to find what you are looking for.
Here is an example:
To find the JDK6 implementation java.util.List, select jdk6, jdk, select browse. Then browse to src/share/classes/java/util/List.java.
You should end up at http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/tip/src/share/classes/java/util/List.java
The latest JDK 8 OpenJDK Java Class Library source code can be found here: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/tip/src/share/classes/
Here is the basic step to get latest or any released version of Openjdk 8 (or any existing java version) source code, and use them in Eclipse.
Steps:
[browse source]
Open url for jdk, e.g http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/
click tags
choose proper tag, e.g jdk8u73-b02
then click browse,
then browse into folder src/share/classes,
[download source]
then click one of bz2 / zip / gz, to download source in relevant compressed format, (e.g for jdk8u73-b02 in zip format, the url will be: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/archive/2ab13901d6f1.zip/src/share/classes/)
[use in eclipse]
uncompress it,
zip the folder "classes/", make "classes/" as the root dir of .zip file, (e.g first cd jdk-2ab13901d6f1/src/share/, then zip -r openjdk_8u73_b2_src.zip classes/)
move the created zip file to proper location, it will stay there for a while, (e.g mv openjdk_8u73_b2_src.zip /media/Eric/software/java/jdk/openjdk/openjdk8u73-b02/source/)
in eclipse, specify source file for jars of installed jre, could specify the source attachment for each jar of installed jre respectively, the most common jar is probably rt.jar,
optionally, might need refresh project to make it totally take effect, not sure is that necessary,
test it: in eclipse, ctrl + shift + t, then input Cancellable, select the sun.nio.fs.Cancellable of corresponding installed jre,
if the source code is available, then it's good, because this source is not available in jdk_home/src.zip, it must be from the additional openjdk source,
switch source back: could switch back to use "jdk_home/src.zip", if don't want to use the external openjdk source,
ok
Here's a way to browse the repositories and look at just the bits you want.
http://hg.openjdk.java.net/
Is that what you are asking?
Append a "/file" to the root URLs to view the browser like this:
http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/
http://hg.openjdk.java.net/jdk7/jdk7/hotspot/file
Grepcode.com is great for similar things - not only OpenJDK sources, with searching in classes/methods and links between classes directly in highlighted code:
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/net/Socket.java
As mentioned in the other answers, the source code repository is at https://hg.openjdk.java.net
However, the OpenJDK team mirrors some of the projects on GitHub: https://github.com/openjdk
Including the latest Java version project (https://hg.openjdk.java.net/jdk/jdk): https://github.com/openjdk/jdk
Surely http://hg.openjdk.java.net is one good option. The other equally good source is zGrepCode https://zgrepcode.com/java/openjdk/ . It has both Open JDK and Oracle java versions.