Permalink
Browse files

Converted ServiceFB and native tasks

  • Loading branch information...
1 parent c703a61 commit 0253bb4e4a1bb14933227e0d5989b1bd7b779e95 @luislavena committed Dec 31, 2009
Showing with 85 additions and 6 deletions.
  1. +6 −0 .gitignore
  2. +1 −1 tasks/gem.rake
  3. +0 −1 tasks/native.rake
  4. +40 −0 tasks/native_lib.rake
  5. +37 −0 tasks/native_service.rake
  6. +1 −4 tools/freebasic.rb
View
@@ -0,0 +1,6 @@
+*.o
+*.a
+*.exe
+bin
+pkg
+tmp
View
@@ -1,6 +1,6 @@
require 'hoe'
-Hoe.spec 'mongrel_service' do
+HOE = Hoe.spec 'mongrel_service' do
self.version = '0.4.0.beta1'
developer 'Luis Lavena', 'luislavena@gmail.com'
View
@@ -1 +0,0 @@
-require 'tools/freebasic'
View
@@ -0,0 +1,40 @@
+require 'tools/freebasic'
+
+# ServiceFB namespace (lib)
+namespace :lib do
+ lib_options = {
+ :debug => false,
+ :profile => false,
+ :errorchecking => :ex,
+ :mt => true,
+ :pedantic => true
+ }
+
+ lib_options[:debug] = true if ENV['DEBUG']
+ lib_options[:profile] = true if ENV['PROFILE']
+ lib_options[:errorchecking] = :exx if ENV['EXX']
+ lib_options[:pedantic] = false if ENV['NOPEDANTIC']
+
+ project_task 'servicefb' do
+ lib 'ServiceFB'
+ build_to 'lib'
+
+ define 'SERVICEFB_DEBUG_LOG' unless ENV['RELEASE']
+ source 'lib/ServiceFB/ServiceFB.bas'
+
+ option lib_options
+ end
+
+ project_task 'servicefb_utils' do
+ lib 'ServiceFB_Utils'
+ build_to 'lib'
+
+ define 'SERVICEFB_DEBUG_LOG' unless ENV['RELEASE']
+ source 'lib/ServiceFB/ServiceFB_Utils.bas'
+
+ option lib_options
+ end
+end
+
+task :native_lib => ["lib:build"]
+task :clean => ["lib:clobber"]
View
@@ -0,0 +1,37 @@
+require 'tools/freebasic'
+
+# mongrel_service (native)
+namespace :native do
+ exe_options = {
+ :debug => false,
+ :profile => false,
+ :errorchecking => :ex,
+ :mt => true,
+ :pedantic => true
+ }
+
+ exe_options[:debug] = true if ENV['DEBUG']
+ exe_options[:profile] = true if ENV['PROFILE']
+ exe_options[:errorchecking] = :exx if ENV['EXX']
+ exe_options[:pedantic] = false if ENV['NOPEDANTIC']
+
+ project_task 'mongrel_service' do
+ executable 'mongrel_service'
+ build_to 'bin'
+
+ define 'DEBUG_LOG' unless ENV['RELEASE']
+ define "GEM_VERSION=#{HOE.spec.version}"
+
+ main 'native/mongrel_service.bas'
+ source 'native/console_process.bas'
+
+ lib_path 'lib'
+ library 'ServiceFB', 'ServiceFB_Utils'
+ library 'user32', 'advapi32', 'psapi'
+
+ option exe_options
+ end
+end
+
+task :native_service => [:native_lib, 'native:build']
+task :clean => ['native:clobber']
View
@@ -32,14 +32,11 @@
# rake projects:my_fb_project:rebuild # Force a rebuild of the my_fb_project files
# rake projects:rebuild # Rebuild all projects
-require 'rake/tasklib'
-require 'pp'
-
module FreeBASIC
# this help me reduce the attempts to remove already removed files.
# works with src_files
CLOBBER = Rake::FileList.new
- ON_WINDOWS = (RUBY_PLATFORM =~ /mswin|cygwin|bccwin/)
+ ON_WINDOWS = (RUBY_PLATFORM =~ /mingw|mswin/)
class ProjectTask
attr_accessor :name

0 comments on commit 0253bb4

Please sign in to comment.