specs/stx-jv.rbspec
changeset 7 b6fe3a90f6e0
parent 4 48ec8a59ced4
child 8 659ebd541dd2
--- a/specs/stx-jv.rbspec	Tue May 24 10:33:45 2016 +0100
+++ b/specs/stx-jv.rbspec	Tue May 24 12:03:26 2016 +0100
@@ -1,12 +1,5 @@
 load "jv-branch.deps.rake"
 
-# Include Hudson build number of builded by Hudson"
-if ENV['BUILD_NUMBER']
-  build_id="build#{ENV['BUILD_NUMBER']}"
-else
-  build_id="#{Time.now.strftime("%Y%m%d")}"
-end
-
 project :'stx:jv-branch-core' do
   # Core Smalltalk/X - does contain only standard libraries,
   # and development tools. Does not contain any other 'features'
@@ -57,18 +50,35 @@
       end
     end
 
-
-    redefine BUILD_DIR / 'stx' / 'stc' => BUILD_DIR do | t |
-      checkout :'swing:private:hg', 'stx/stc', :branch => 'jv'
+    redefine BUILD_DIR / 'stx' / 'stc' => BUILD_DIR do
+      if core_developer_machine? then
+        checkout :'swing:private:hg', 'stx/stc', :branch => 'jv'
+      else
+        lastSicessfulBuild = Jenkins::Build.new(%q{https://swing.fit.cvut.cz/jenkins/job/stx_jv_new/ARCH=i386,PLATFORM=LinuxN/lastSuccessfulBuild})
+        lastSicessfulBuild.artifacs(/prebuilt\-stc/).each do | each |
+          if not each.name.end_with? '.sha256' then
+            each.download_to(BUILD_DIR / 'stx')
+            unzip BUILD_DIR / 'stx' / each.name
+          end
+        end
+      end
     end
 
-    redefine BUILD_DIR / 'stx' / 'librun' => BUILD_DIR do | t |
-      checkout :'swing:private:hg', 'stx/librun', :branch => 'jv'
+    redefine BUILD_DIR / 'stx' / 'librun' => BUILD_DIR do      
+      if core_developer_machine? then
+        checkout :'swing:private:hg', 'stx/librun', :branch => 'jv'
+      else        
+        lastSicessfulBuild = Jenkins::Build.new(%q{https://swing.fit.cvut.cz/jenkins/job/stx_jv_new/ARCH=i386,PLATFORM=LinuxN/lastSuccessfulBuild})
+        lastSicessfulBuild.artifacs(/prebuilt\-librun/).each do | each |
+          if not each.name.end_with? '.sha256' then
+            each.download_to(BUILD_DIR / 'stx')
+            unzip BUILD_DIR / 'stx' / each.name
+          end
+        end
+      end
     end
 
     if win32?
-
-
       task :'checkout:post' do
         rm_f BUILD_DIR / 'stx' / 'projects' / 'smalltalk' / 'stx_splash.bmp'
       end
@@ -377,7 +387,7 @@
     end
   end
   ver = (ver.split(".")[0..2]).join(".")
-  project.app_version "#{ver}_#{build_id}"
+  project.app_version "#{ver}_#{BUILD_ID}"
   # This is really ugly. We need to clean that up...
   BUILD_NAME.replace "#{project.app_name}-#{project.app_version}_#{ARCH}-#{win32? ? 'win32' : RbConfig::CONFIG['host_os']}"
 end