7 Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
10 Taejun Ha <taejun.ha@samsung.com>
11 Jiil Hyoun <jiil.hyoun@samsung.com>
12 Donghyuk Yang <donghyuk.yang@samsung.com>
13 DongHee Yang <donghee.yang@samsung.com>
15 Licensed under the Apache License, Version 2.0 (the "License");
16 you may not use this file except in compliance with the License.
17 You may obtain a copy of the License at
19 http://www.apache.org/licenses/LICENSE-2.0
21 Unless required by applicable law or agreed to in writing, software
22 distributed under the License is distributed on an "AS IS" BASIS,
23 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 See the License for the specific language governing permissions and
25 limitations under the License.
31 $LOAD_PATH.unshift File.dirname(__FILE__)+"/src/common"
32 $LOAD_PATH.unshift File.dirname(__FILE__)+"/src/pkg_server"
33 $LOAD_PATH.unshift File.dirname(__FILE__)+"/src/builder"
35 require "packageServer"
37 require "optionparser"
41 #generate server when local package server is not set
43 # if "--os" is not specified, use host os type
44 if option[:os].nil? then
45 option[:os] = Utils::HOST_OS
47 if not option[:os] =~ /^(linux|windows|darwin)$/ then
48 puts "We have no plan to Buld OS \"#{option[:os]}\" \n please check your option OS "
54 if not File.exist? "package" then
55 puts "current dirctory \"#{path}\" is not package root directory"
60 if not option[:url].nil? then
62 builder = Builder.get("default")
63 if builder.pkgserver_url != option[:url] then
64 puts "Package server URL has been changed! Creating new builder..."
65 builder = Builder.create("default", option[:url], nil)
68 puts "Default builder does not exist! Creating new builder..."
69 builder = Builder.create("default", option[:url], nil)
71 else # if url is not specified
73 builder = Builder.get("default")
75 puts "Default builder does not exist! Creating new builder..."
76 builder = Builder.create("default", "http://172.21.111.132/pkgserver/unstable",nil)
81 if not builder.build( Utils::WORKING_DIR, option[:os], option[:clean], option[:rev], [], []) then
84 puts "Build Succeeded!"