From bf26efc551e56d21a24049952ebe81f9686df5ec Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 16 Jan 2014 15:33:05 +0100 Subject: [PATCH] Little hack until we can install xsltproc on the buildslave --- tools/appliance/build.sh | 2 +- tools/appliance/convert/Convert.class | Bin 0 -> 984 bytes tools/appliance/convert/Convert.java | 34 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tools/appliance/convert/Convert.class create mode 100644 tools/appliance/convert/Convert.java diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index 9a201f9ecc3..e52208c3cf0 100644 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -94,7 +94,7 @@ bzip2 $appliance-$build_date-$branch-vmware.vmdk echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.vmdk.bz2" vboxmanage export $machine_uuid --output $appliance-$build_date-$branch-vmware.ovf mv $appliance-$build_date-$branch-vmware.ovf $appliance-$build_date-$branch-vmware.ovf-orig -xsltproc convert_ovf_vbox_to_esx.xslt $appliance-$build_date-$branch-vmware.ovf-orig > $appliance-$build_date-$branch-vmware.ovf +java -cp convert convert_ovf_vbox_to_esx.xslt $appliance-$build_date-$branch-vmware.ovf-orig $appliance-$build_date-$branch-vmware.ovf tar -cf $appliance-$build_date-$branch-vmware.ova $appliance-$build_date-$branch-vmware.ovf $appliance-$build_date-$branch-vmware-disk1.vmdk rm -f $appliance-$build_date-$branch-vmware.ovf $appliance-$build_date-$branch-vmware.ovf-orig $appliance-$build_date-$branch-vmware-disk1.vmdk echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.ova" diff --git a/tools/appliance/convert/Convert.class b/tools/appliance/convert/Convert.class new file mode 100644 index 0000000000000000000000000000000000000000..fca4dd30deb19b83494c266ec91d865ad69ffdc2 GIT binary patch literal 984 zcma)5+iuf95IvhX*~BruP+I7X(gLlMUJUIULGVx!6e+Y)Q;;g29J5re;x)22CH*X3 z8bl;MfR94V+G!e9Rf8XPyk}9S;c*gOZA^+N!zIwxuwacFvjQ#M7V3=(9QXF)GmWYnsR+|tbaDB-zXMb*- zx#zCacIBzlRFN-FtNNh%uIq_!$`57CvCgrvV&*qas(vU&APHVigHD&@5!qOq3;|_d`b~)mgUmvTb1p&i~{&5^<-k zI9^zIiCqRhsET3gy0OF7neY_D%oSPvaM&NiVuDJcoR3HK=7m&lcf@OJ@6A?@ubL9k zNa*^Q(3V?oQKA9RUj|G+FIp#Qw@j9i%~g6}Kj?>~ zrZt~{1r#xj`*cKy#xx%}vhRN))9536(uZ+U$?o=$>mmPPbL$fPV2B$7{FSjiZ}d?} tqjM=*yo7m8wm@`%9>@~rsLCa(&LPSgl`=z~0!`@y%#x4cA?-7G^bd471RDSV literal 0 HcmV?d00001 diff --git a/tools/appliance/convert/Convert.java b/tools/appliance/convert/Convert.java new file mode 100644 index 00000000000..e29fdb2a6a1 --- /dev/null +++ b/tools/appliance/convert/Convert.java @@ -0,0 +1,34 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +import javax.xml.transform.*; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; + +public class Convert { + public static void main(String[] args) throws IOException, URISyntaxException, TransformerException { + TransformerFactory factory = TransformerFactory.newInstance(); + Source xslt = new StreamSource(new File(args[0])); + Transformer transformer = factory.newTransformer(xslt); + + Source text = new StreamSource(new File(args[1])); + transformer.transform(text, new StreamResult(new File(args[2]))); + } +}