chg: replaced some ant tasks with yarn scripts

This commit is contained in:
Tobi Schäfer 2020-03-29 20:08:05 +02:00
parent e86d3f0a9e
commit f555a0e417
29 changed files with 234 additions and 253 deletions

1
.gitignore vendored
View file

@ -12,3 +12,4 @@ local/
node_modules/
static/export/
static/sites/
lib/

View file

@ -1,4 +1,6 @@
window.CodeMirror = require('codemirror/lib/codemirror');
window.marked = require('marked/lib/marked');
require('codemirror/mode/css/css');
require('codemirror/mode/gfm/gfm');
require('codemirror/mode/htmlmixed/htmlmixed');
@ -7,5 +9,4 @@ require('codemirror/mode/markdown/markdown');
require('codemirror/mode/xml/xml');
require('./cm-skin-mode');
window.marked = require('marked/lib/marked');
require('uikit/dist/js/components/htmleditor');

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,12 +0,0 @@
H2 is dual licensed and available under a modified version of the MPL 1.1 (Mozilla Public License) or under the (unmodified) EPL 1.0 (Eclipse Public License). The changes to the MPL are underlined. There is a License FAQ for both the MPL and the EPL, most of that is applicable to the H2 License as well.
* You can use H2 for free. You can integrate it into your application (including commercial applications), and you can distribute it.
* Files containing only your code are not covered by this license (it is 'commercial friendly').
* Modifications to the H2 source code must be published.
* You don't need to provide the source code of H2 if you did not modify anything.
However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2. This happened to HSQLDB: a company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it, hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the Wayback Machine and visit old web pages of http://www.bungisoft.com.
About porting the source code to another language (for example C# or C++): converted source code (even if done manually) stays under the same copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code.
For the full license text see http://www.h2database.com/html/license.html.

Binary file not shown.

Binary file not shown.

View file

@ -1,83 +0,0 @@
::
:: The Antville Project
:: http://code.google.com/p/antville
::
:: Copyright 20012014 by the Workers of Antville.
::
:: 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.
::
@echo off
set JAVA_HOME=
set HOP_HOME=
set HTTP_PORT=
set XMLRPC_PORT=
set AJP13_PORT=
set RMI_PORT=
set CONFIG_FILE=
set OPTIONS=
set HTTP_PORT=8080
rem set XMLRPC_PORT=8081
rem set AJP13_PORT=8009
rem set RMI_PORT=5050
rem set CONFIGFILE=./etc/jetty.xml
rem set HOP_HOME="c:\program files\helma"
rem set JAVA_HOME="c:\program files\java"
set JAVA_OPTIONS=-Djava.awt.headless=true -Dfile.encoding=utf-8
set INSTALL_DIR=%~d0%~p0
if "%JAVA_HOME%"=="" goto default
set JAVACMD=%JAVA_HOME%\bin\java
goto end
:default
set JAVACMD=java
:end
if "%HOP_HOME%"=="" (
set HOP_HOME=%INSTALL_DIR%
)
cd %HOP_HOME%
if not "%CONFIG_FILE%"=="" (
echo Using configuration file %CONFIG_FILE%
set OPTION=%OPTIONS% -c %CONFIG_FILE%
goto java
)
if not "%HTTP_PORT%"=="" (
echo Starting HTTP server on port %HTTP_PORT%
set OPTIONS=%OPTIONS% -w %HTTP_PORT%
)
if not "%XMLRPC_PORT%"=="" (
echo Starting XML-RPC server on port %XMLRPC_PORT%
set OPTIONS=%OPTIONS% -x %XMLRPC_PORT%
)
if not "%AJP13_PORT%"=="" (
echo Starting AJP13 listener on port %AJP13_PORT%
set OPTIONS=%OPTIONS% -jk %AJP13_PORT%
)
if not "%RMI_PORT%"=="" (
echo Starting RMI server on port %RMI_PORT%
set OPTIONS=%OPTIONS% -p %RMI_PORT%
)
if not "%HOP_HOME%"=="" (
echo Serving applications from %HOP_HOME%
set OPTIONS=%OPTIONS% -h "%HOP_HOME%
)
:java
%JAVACMD% %JAVA_OPTIONS% -jar "%INSTALL_DIR%\launcher.jar" %OPTIONS%

View file

@ -1,80 +0,0 @@
# The Antville Project
# http://code.google.com/p/antville
#
# Copyright 20012014 by the Workers of Antville.
#
# 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.
#!/bin/sh
HTTP_PORT=8080
#XMLRPC_PORT=8081
#AJP13_PORT=8009
#RMI_PORT=5050
#CONFIG_FILE=./etc/jetty.xml
#JAVA_HOME=/usr/lib/java
#HOP_HOME=/usr/local/helma
JAVA_OPTIONS="-Djava.awt.headless=true -Dfile.encoding=utf-8"
if [ "$JAVA_HOME" ]; then
JAVACMD="$JAVA_HOME/bin/java"
# Check if java command is executable
if [ ! -x $JAVACMD ]; then
echo "Warning: JAVA_HOME variable may be set incorrectly:"
echo " No executable found at $JAVACMD"
fi
else
JAVACMD=java
fi
INSTALL_DIR="${0%/*}"
cd $INSTALL_DIR
INSTALL_DIR=$PWD
if [ -z "$HOP_HOME" ]; then
HOP_HOME="${0%/*}"
cd $HOP_HOME
HOP_HOME=$PWD
else
cd $HOP_HOME
fi
echo "Starting Helma in directory $HOP_HOME"
if [ "$CONFIG_FILE" ]; then
SWITCHES="$SWITCHES -c $CONFIG_FILE"
echo Using configuration file $CONFIG_FILE
else
if [ "$HTTP_PORT" ]; then
SWITCHES="$SWITCHES -w $HTTP_PORT"
echo Starting HTTP server on port $HTTP_PORT
fi
if [ "$XMLRPC_PORT" ]; then
SWITCHES="$SWITCHES -x $XMLRPC_PORT"
echo Starting XML-RPC server on port $XMLRPC_PORT
fi
if [ "$AJP13_PORT" ]; then
SWITCHES="$SWITCHES -jk $AJP13_PORT"
echo Starting AJP13 listener on port $AJP13_PORT
fi
if [ "$RMI_PORT" ]; then
SWITCHES="$SWITCHES -p $RMI_PORT"
echo Starting RMI server on port $RMI_PORT
fi
if [ "$HOP_HOME" ]; then
SWITCHES="$SWITCHES -h $HOP_HOME"
fi
fi
$JAVACMD $JAVA_OPTIONS -jar "$INSTALL_DIR/launcher.jar" $SWITCHES

View file

@ -50,6 +50,7 @@ app.addRepository('modules/jala/code/Utilities.js');
fname.endsWith('.js') && app.addRepository(app.dir + '/../i18n/' + fname);
}
})();
// I18n.js needs to be added *after* the message files or the translations get lost
app.addRepository('modules/jala/code/I18n.js');

View file

@ -17,5 +17,5 @@
antville.url = jdbc:h2:./db/antville;ifexists=true;mode=postgresql
antville.driver = org.h2.Driver
antville.user = sa
antville.password =
antville.user = antville
antville.password = antville

View file

@ -177,6 +177,8 @@ create table metadata (
create index metadata_parent_idx on metadata (parent_type, parent_id);
create index metadata_name_idx on metadata (name);
-- This returns an error in H2 database
create index metadata_value_idx on metadata using hash (value);
--!helma <% #end_of_metadata %>

View file

@ -1,49 +0,0 @@
Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions, and the disclaimer that follows
these conditions in the documentation and/or other materials
provided with the distribution.
3. The name "JDOM" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact <request_AT_jdom_DOT_org>.
4. Products derived from this software may not be called "JDOM", nor
may "JDOM" appear in their name, without prior written permission
from the JDOM Project Management <request_AT_jdom_DOT_org>.
In addition, we request (but do not require) that you include in the
end-user documentation provided with the redistribution and/or in the
software itself an acknowledgement equivalent to the following:
"This product includes software developed by the
JDOM Project (http://www.jdom.org/)."
Alternatively, the acknowledgment may be graphical using the logos
available at http://www.jdom.org/images/logos.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
This software consists of voluntary contributions made by many
individuals on behalf of the JDOM Project and was originally
created by Jason Hunter <jhunter_AT_jdom_DOT_org> and
Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information
on the JDOM Project, please see <http://www.jdom.org/>.

View file

@ -1,13 +0,0 @@
Copyright 2004 Sun Microsystems, Inc.
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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,6 +1,6 @@
{
"name": "antville",
"version": "1.6.18",
"version": "1.618",
"description": "Antville is an open source project aimed at the development of a high performance, feature rich weblog hosting software. It can easily host up to several thousands of sites (the number of weblogs is rather limited by the installation owners choice and server power than by software limitations).",
"main": "main.js",
"directories": {
@ -8,18 +8,12 @@
"test": "tests"
},
"scripts": {
"build": "yarn build:fonts; yarn build:main; yarn build:editor",
"build:editor": "yarn build:editor:scripts; yarn build:editor:styles",
"build:editor:scripts": "browserify build/client/editor.js -o static/scripts/editor.min.js -d -p [minifyify --map /static/scripts/editor.min.map.json --output static/scripts/editor.min.map.json]",
"build:editor:styles": "lessc --clean-css build/client/editor.less static/styles/editor.min.css",
"build:fonts": "cp -Rp ./node_modules/uikit/dist/fonts static/",
"build:main": "yarn build:main:scripts; yarn build:main:styles",
"build:main:scripts": "browserify build/client/main.js -o static/scripts/main.min.js -d -p [minifyify --map /static/scripts/main.min.map.json --output static/scripts/main.min.map.json]",
"build:main:styles": "lessc --clean-css build/client/main.less static/styles/main.min.css",
"jars": "yarn jar:jdom; yarn jar:less; yarn jar:rome",
"jar:jdom": "(cd lib; curl -LO https://repo1.maven.org/maven2/jdom/jdom/1.0/jdom-1.0.jar)",
"jar:less": "(cd lib; curl -LO https://repo1.maven.org/maven2/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar)",
"jar:rome": "(cd lib; curl -LO https://repo1.maven.org/maven2/rome/rome/1.0/rome-1.0.jar)"
"antclick": "tools/antclick.sh",
"build": "tools/build.sh",
"clean": "rm -rf build/work",
"export": "tools/export.sh",
"jars": "tools/jars.sh",
"package": "tools/package.sh"
},
"repository": {
"type": "git",

76
tools/antclick.sh Executable file
View file

@ -0,0 +1,76 @@
#!/usr/bin/env sh
. tools/init.sh
helma_package=https://github.com/antville/helma/releases/download/v20200321/helma-20200329.tgz
# Build dependencies
yarn build
(
cd $export_dir
mkdir -p antclick
echo Downloading Helma package…
$curl $helma_package
package_file=$(basename $helma_package)
# FIXME: Remove when Helma package is released (and uncomment line 12)
#cp /home/tobi/Projects/helma/current/build/distributions/$package_file .
echo Extracting Helma package…
tar -xzf $package_file --strip-components=1 -C antclick
cd antclick
echo Removing unneeded files…
rm -rf apps/* db/* docs extras
rm -rf apps/antville/docs apps/antville/tools
echo Copying Antville application into Helma installation…
cp -r $export_dir/antville apps/
cp $export_dir/antville/tools/antclick/apps.properties .
echo Downloading H2 database…
mkdir -p lib/ext
cd lib/ext
jar_path=com/h2database/h2/1.4.200/h2-1.4.200.jar
jar_file=$(basename $jar_path)
license_dir=../../licenses/$jar_file/META-INF
$curl $jar_repo/$jar_path
mkdir -p $license_dir
curl -L# https://raw.githubusercontent.com/h2database/h2database/master/LICENSE.txt > $license_dir/LICENSE.txt
cd -
rm -f db/antville.mv.db
echo Initializing Antville schema in H2 database…
java -cp lib/ext/h2-1.4.200.jar org.h2.tools.RunScript \
-continueOnError \
-script apps/antville/db/postgre.sql \
-url jdbc:h2:./db/antville \
-user antville \
-password antville
echo Generating .tbz package…
cd ..
mkdir -p $dist_dir
package_name=antclick-$npm_package_version
tar -cjf $dist_dir/$package_name.tbz antclick
echo Generating .zip package…
zip -lqr $dist_dir/$package_name.zip antclick
)

39
tools/build.sh Executable file
View file

@ -0,0 +1,39 @@
#!/usr/bin/env bash
. tools/init.sh
# Build dependencies
yarn export
yarn jars
(
cd $export_dir/antville
echo Installing dependencies…
yarn install
echo Building client-side scripts…
prefix=static/scripts/main.min
yarn browserify build/client/main.js -o $prefix.js -d -p [minifyify --map /$prefix.map.json --output $prefix.map.json]
yarn lessc --clean-css build/client/main.less static/styles/main.min.css
prefix=static/scripts/editor.min
yarn browserify build/client/editor.js -o $prefix.js -d -p [minifyify --map /$prefix.map.json --output $prefix.map.json]
yarn lessc --clean-css build/client/editor.less static/styles/editor.min.css
echo Copying statcic files…
cp -Rp ./node_modules/uikit/dist/fonts static/
echo Generate license file…
# FIXME: Add output of this command to somewhere…
yarn licenses generate-disclaimer > /dev/null
echo Removing unneeded dependencies…
find node_modules/* -maxdepth 0 -not \( -path */string-strip-html -o -path */marked \) -print0 | xargs -0 rm -rf
rm -rf node_modules/.[^.]*
)

34
tools/export.sh Executable file
View file

@ -0,0 +1,34 @@
#!/usr/bin/env sh
. tools/init.sh
rm -rf $source_dir
mkdir -p $source_dir
(
echo Cloning repository…
cd $source_dir
git clone $antville_repo antville
export_dir=$export_dir/antville
echo Exporting application…
cd antville
git checkout develop
git checkout-index -f -a --prefix=$export_dir/
hash=$(git rev-parse --short HEAD)
cd $export_dir
root_js_file=code/Root/Root.js
sed -i "s|<v>0</v>|$npm_package_version|g" $root_js_file
sed -i "s|<h>0</h>|$hash|g" $root_js_file
sed -i "s|<d/>|$(date +"%b %d, %Y")|g" $root_js_file
echo Removing unneeded files…
#rm -rf .git* build.xml build docs i18n/*.po*
)

15
tools/init.sh Normal file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env sh
base_dir=$(pwd)
build_dir=$base_dir/build
work_dir=$build_dir/work
dist_dir=$work_dir/dist
export_dir=$work_dir/export
source_dir=$work_dir/src
jar_repo=https://repo1.maven.org/maven2
antville_repo=https://github.com/antville/antville.git
#antville_repo=/home/tobi/Projects/antville/current
curl="curl -LO#"

36
tools/jars.sh Executable file
View file

@ -0,0 +1,36 @@
#!/usr/bin/env sh
. tools/init.sh
jar_dir=$export_dir/antville/lib
license_dir=$export_dir/antville/licenses
echo $license_dir
(
mkdir -p $jar_dir
mkdir -p $license_dir
cd $jar_dir
echo Downloading jdom.jar…
jar_path=jdom/jdom/1.0/jdom-1.0.jar
jar_file=$(basename $jar_path)
$curl $jar_repo/$jar_path
unzip -lp $jar_file META-INF/LICENSE.txt > $license_dir/jdom.txt
echo Downloading lesscss.jar
jar_path=org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar
jar_file=$(basename $jar_path)
$curl $jar_repo/$jar_path
unzip -lp $jar_file META-INF/LICENSE.txt > $license_dir/lesscss.txt
echo Downloading rome.jar…
$curl $jar_repo/rome/rome/1.0/rome-1.0.jar
curl -L# https://raw.githubusercontent.com/rometools/rome/master/LICENSE > $license_dir/rome.txt
)

19
tools/package.sh Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env sh
. tools/init.sh
# Build dependencies
yarn build
package_name=antville-$npm_package_version
mkdir -p $dist_dir
echo Generating .tbz package…
cd $export_dir
tar -cjf $dist_dir/$package_name.tbz antville
echo Generating .zip package…
zip -lqr $dist_dir/$package_name.zip antville