# Copyright (c) 2010 The Mirah project authors. All Rights Reserved. # All contributing project authors may be found in the NOTICE file. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'ant' require 'appengine-sdk' $: << '../../../lib' require 'mirah_task' JUNIT_JAR = '../../../javalib/junit.jar' TESTING_JARS = [AppEngine::SDK::API_JAR, AppEngine::SDK::LABS_JAR, JUNIT_JAR] + AppEngine::SDK::RUNTIME_JARS.reject {|j| j =~ /appengine-local-runtime/} TESTING_JARS.each {|jar| $CLASSPATH << jar} # Mirah.compiler_options = ['-V'] task :default => :test task :init do mkdir_p 'dist' mkdir_p 'build' end task :clean do ant.delete :quiet => true, :dir => 'build' ant.delete :quiet => true, :dir => 'dist' end task :compile => :init do # build the Mirah sources puts "Compiling Mirah sources" mirahc 'com/google/appengine', :dir => 'src', :dest => 'build' end task :compile_test => :jar do puts "Compiling Mirah tests" mirahc 'com/google/appengine', :dir => 'test', :dest => 'test', :options => ['--classpath', Dir.pwd + "/dist/dubydatastore.jar"] end task :jar => :compile do ant.jar :jarfile => 'dist/dubydatastore.jar' do fileset :dir => 'lib' fileset :dir => 'build' end end task :test => :compile_test do ant.junit :haltonfailure => 'true', :fork => 'true' do classpath :path => (TESTING_JARS + ['build', 'test']).join(":") batchtest do fileset :dir => "test" do include :name => '**/*Test.class' end formatter :type => 'plain', :usefile => 'false' end end end