buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Pyatigorskiy <ata...@gmail.com>
Subject Re: file modification time stopped working (?)
Date Fri, 25 Mar 2011 09:01:57 GMT
This could also be related to me using buildr 1.4.5 instead of 1.4.3
on the old pc. I was able to find out *what* happens, but not *why* or
how to fix it =(
Essentially on a dirty build the war task picks up a dependency on a
file instead of a dir breaking the link. I.e. I expect the war task to
depend on the gwt dir which depends on the gwt_sources file list, so
when gwt_sources are updated this triggers the rebuild, but instead
the war task suddenly starts to depend on the *contents* of gwt dir.
The contents does not depend on anything so this doesn't trigger the
rebuild =(

Please see below for a reproducible testcase:

define "proj" do
  project.version = "0.0.1"

  define "web" do
    gwt_sources = FileList[_("src/main/java/*")]
	gwt_dest = _("target/gwt")
	ft = file gwt_dest => gwt_sources do |t|
	  puts "rebuilding gwt"
	  rm_rf _("target/gwt")
	  mkdir_p _("target/gwt")
	  File.open(_("target/gwt/gwt_out.txt"), 'w') {|f| f.write("some output") }
	end
	
	puts ft.investigation
	
	package(:war).enhance do |t|
	  puts t.investigation
	end
	package(:war).include(gwt_dest, :as =>".")
  end

src/main/java contains one file SomeClass.java. Now look, what happens
when I build->modify->build:

looser@MEEKS-PC /c/dev/buildr_test
$ buildr clean package
(in c:/dev/buildr_test, development)
------------------------------
Investigating c:/dev/buildr_test/web/target/gwt
class: Rake::FileTask
task needed: false
timestamp: Fri Mar 25 12:54:17 +0400 2011
pre-requisites:
--c:/dev/buildr_test/web/src/main/java/SomeClass.java (Fri Mar 25
12:50:42 +0400 2011)
latest-prerequisite time: Fri Mar 25 12:50:42 +0400 2011
................................

Cleaning proj
Building proj
Compiling proj:web into c:/dev/buildr_test/web/target/classes
Packaging proj
rebuilding gwt
Packaging proj-web-0.0.1.war
------------------------------
Investigating c:/dev/buildr_test/web/target/proj-web-0.0.1.war
class: Buildr::Packaging::Java::WarTask
task needed: true
timestamp: <EARLY TIME>
pre-requisites:
--proj:web:build (Fri Mar 25 12:57:08 +0400 2011)
--c:/dev/buildr_test/web/target/gwt (Fri Mar 25 12:57:08 +0400 2011)
<<< this is what I wanted!
latest-prerequisite time: Fri Mar 25 12:57:08 +0400 2011
................................

Running integration tests...
Completed in 0.935s

looser@MEEKS-PC /c/dev/buildr_test
$ touch web/src/main/java/SomeClass.java

looser@MEEKS-PC /c/dev/buildr_test
$ buildr package
(in c:/dev/buildr_test, development)
------------------------------
Investigating c:/dev/buildr_test/web/target/gwt
class: Rake::FileTask
task needed: true
timestamp: Fri Mar 25 12:57:08 +0400 2011
pre-requisites:
--c:/dev/buildr_test/web/src/main/java/SomeClass.java (Fri Mar 25
12:57:44 +0400 2011)
latest-prerequisite time: Fri Mar 25 12:57:44 +0400 2011
................................

Building proj
Compiling proj:web into c:/dev/buildr_test/web/target/classes
Packaging proj
Packaging proj-web-0.0.1.war
------------------------------
Investigating c:/dev/buildr_test/web/target/proj-web-0.0.1.war
class: Buildr::Packaging::Java::WarTask
task needed: true
timestamp: Fri Mar 25 12:57:08 +0400 2011
pre-requisites:
--c:/dev/buildr_test/web/target/gwt/gwt_out.txt (Fri Mar 25 12:57:08
+0400 2011) <<< this is wrong!!!
--proj:web:build (Fri Mar 25 12:57:55 +0400 2011)
latest-prerequisite time: Fri Mar 25 12:57:55 +0400 2011
................................

Running integration tests...
Completed in 0.913s


On Fri, Mar 25, 2011 at 11:55 AM, Ilya Pyatigorskiy <atamur@gmail.com> wrote:
> Hi,
>
> I've got a strange problem: on a new pc I'm using my build doesn't
> detected file changes. I.e. if I do a build, then touch a file and
> then do a build again the second build does nothing as it doesn't
> notice the file change. How could I debug such a problem? Is there any
> way to print out the modification times etc?
>
> My OS is Win7.
>
> Thank you,
> Ilya
>

Mime
View raw message