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.
33 $LOAD_PATH.unshift File.dirname(__FILE__)+"/src/common"
34 $LOAD_PATH.unshift File.dirname(__FILE__)+"/src/build_server"
36 require "BuildClientOptionParser"
42 # if "--os" is not specified, use host os type
43 if option[:os].nil? then
44 option[:os] = Utils::HOST_OS
46 if not option[:os] =~ /^(linux|windows|darwin)$/ then
47 puts "We have no plan to Buld OS \"#{option[:os]}\" \n please check your option OS "
52 if option[:domain].nil? then
53 option[:domain] = "127.0.0.1"
56 if option[:port].nil? then
63 client = BuildCommClient.create( option[:domain], option[:port])
64 if not client.nil? then
65 client.send "BUILD,GIT,#{option[:git]},#{option[:commit]},#{option[:os]},,#{option[:async]}"
70 client = BuildCommClient.create( option[:domain], option[:port])
71 if not client.nil? then
72 client.send "RESOLVE,GIT,#{option[:git]},#{option[:commit]},#{option[:os]},,#{option[:async]}"
78 client = BuildCommClient.create( option[:domain], option[:port])
79 if not client.nil? then
80 client.send "QUERY,SYSTEM"
81 result0 = client.receive_data()
86 result0 = result0[0].split(",").map { |x| x.strip }
87 puts "HOST-OS: #{result0[0]}"
88 puts "MAX_WORKING_JOBS: #{result0[1]}"
93 client = BuildCommClient.create( option[:domain], option[:port])
94 if not client.nil? then
95 client.send "QUERY,JOB"
96 result1 = client.receive_data()
103 tok = item.split(",").map { |x| x.strip }
104 puts "#{tok[1]} #{tok[0]} #{tok[2]}"
109 raise RuntimeError, "input option incorrect : #{option[:cmd]}"