xref: /aosp_15_r20/external/apache-velocity-engine/velocity-engine-examples/src/etc/build.sh (revision 6626518d3d1a3a4cd21045b7974855fd6a3e2103)
1*6626518dSAndrew Vuong#!/bin/sh
2*6626518dSAndrew Vuong
3*6626518dSAndrew Vuong# Licensed to the Apache Software Foundation (ASF) under one
4*6626518dSAndrew Vuong# or more contributor license agreements.  See the NOTICE file
5*6626518dSAndrew Vuong# distributed with this work for additional information
6*6626518dSAndrew Vuong# regarding copyright ownership.  The ASF licenses this file
7*6626518dSAndrew Vuong# to you under the Apache License, Version 2.0 (the
8*6626518dSAndrew Vuong# "License"); you may not use this file except in compliance
9*6626518dSAndrew Vuong# with the License.  You may obtain a copy of the License at
10*6626518dSAndrew Vuong#
11*6626518dSAndrew Vuong#   http://www.apache.org/licenses/LICENSE-2.0
12*6626518dSAndrew Vuong#
13*6626518dSAndrew Vuong# Unless required by applicable law or agreed to in writing,
14*6626518dSAndrew Vuong# software distributed under the License is distributed on an
15*6626518dSAndrew Vuong# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6626518dSAndrew Vuong# KIND, either express or implied.  See the License for the
17*6626518dSAndrew Vuong# specific language governing permissions and limitations
18*6626518dSAndrew Vuong# under the License.
19*6626518dSAndrew Vuong
20*6626518dSAndrew Vuongecho "Building examples..."
21*6626518dSAndrew Vuong
22*6626518dSAndrew Vuongecho rm lib/${project.build.finalName}.jar
23*6626518dSAndrew Vuongrm lib/${project.build.finalName}.jar
24*6626518dSAndrew Vuong
25*6626518dSAndrew Vuong_VELCP=.
26*6626518dSAndrew Vuongfor i in lib/*.jar
27*6626518dSAndrew Vuongdo
28*6626518dSAndrew Vuong    _VELCP="$_VELCP:$i"
29*6626518dSAndrew Vuongdone
30*6626518dSAndrew Vuong
31*6626518dSAndrew Vuong# convert the unix path to windows
32*6626518dSAndrew Vuongif [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
33*6626518dSAndrew Vuong    _VELCP=`cygpath --path --windows "$_VELCP"`
34*6626518dSAndrew Vuongfi
35*6626518dSAndrew Vuong
36*6626518dSAndrew Vuongecho "Using classpath $_VELCP"
37*6626518dSAndrew Vuong
38*6626518dSAndrew Vuongfind src -name "*.java" > sources.txt
39*6626518dSAndrew Vuongmkdir classes
40*6626518dSAndrew Vuongjavac -cp $_VELCP -d classes @sources.txt && jar cf lib/${project.build.finalName}.jar -C classes . && echo "Build successful."
41