{"id":1924,"date":"2017-12-06T11:41:07","date_gmt":"2017-12-06T11:41:07","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1924"},"modified":"2020-01-09T09:42:34","modified_gmt":"2020-01-09T09:42:34","slug":"ant-cpptask-with-ivy","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/ant-cpptask-with-ivy\/","title":{"rendered":"Ant cpptask with ivy"},"content":{"rendered":"<p><strong>rajeshkumar created the topic: ant cpptask with ivy<\/strong><br \/>\nQuestions:<br \/>\nA company I am working for, has some c binaries build with ant using cpptask. They use ivy to retrieve shared c libraries every time we start a build which wastes a significant amount of time comparing the revisions and downloading, when then only need to be download if the header files have changed. I have added a target which sets a var, which causes the build to skip over the ivy steps but I&#8217;d like a better solution. I see that cpptask creates a file history.xml and only rebuilds to binary if any of the sources have change. I&#8217;d like to know if there is way to independently test if the binary needs to build, and it does, I&#8217;d like it fire off the ivy targets. I&#8217;d also like for a variable to be set if the binary was rebuilt so that I can conditionally start an rpm generation task<\/p>\n<p>Answer:\n<project name=\"conditional_compile\" default=\"build\">\n<p>    <condition property=\"file.modified\"><br \/>\n        <isfileselected file=\"test.txt\"><br \/>\n            <modified\/><br \/>\n        <\/isfileselected><br \/>\n    <\/condition><\/p>\n<p>    <target name=\"build\" if=\"file.modified\"><br \/>\n        <echo message=\"This is a compile step that depends on the modification of a file\"\/><br \/>\n    <\/target><\/p>\n<\/project>\n<p>Regards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>rajeshkumar created the topic: ant cpptask with ivy Questions: A company I am working for, has some c binaries build with ant using cpptask. They use ivy to retrieve shared c libraries every time we start a build which wastes a significant amount of time comparing the revisions and downloading, when then only need to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[12],"tags":[209],"class_list":["post-1924","post","type-post","status-publish","format-standard","hentry","category-apache-ant","tag-ant"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=1924"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1924\/revisions"}],"predecessor-version":[{"id":1925,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1924\/revisions\/1925"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=1924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=1924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=1924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}