Hi,
In a thread a while back, I asked about building on win32 and suggested to
improve the documentation[1].
At first I wanted to take a look at the website and try to figure out how
it all connects.
This is the first in what I hope will be a series of patches to improve the
website.
I have a few things in mind:
- Building the website on Windows.
- Fix ASF website check nag about missing link to the privacy policy [2]
- Making the website more mobile friendly (basically a responsive CSS that
will fold the menu into a hamburger when browsing on limited width, adding
website manifest etc, compare with https://subversion.apache.org where I
did the same thing in r1891758 [3]).
- Getting APR to build under Visual Studio 2022 and documenting my progress
in compiling_win32.html
If someone feels strongly about anything of the above ("don't waste your
time!"), please chime in.
With the introduction done, I'm attaching two patches to create a
"build.bat" file (replicating the job done by build.sh). I initially copied
build.sh to create the first patch:
[[[
C:\devel\apr_site>svn copy build.sh build.bat
...edit...
c:\devel\apr_site>svn diff >build_bat_coppiedfromsh.txt
]]]
However the copy-from didn't turn up in the patch (and I should probably
have known that) and since I wasn't sure if this was even wanted, I've also
created a plain patch with the file added from scratch.
Kind regards,
Daniel Sahlberg
[1] https://lists.apache.org/thread/b40v59rr36odjn6ykphl561vk89y623l
[2] https://whimsy.apache.org/site/project/apr
[3] https://svn.apache.org/viewvc?view=revision&revision=1891758
Index: build.bat
===================================================================
--- build.bat (nonexistent)
+++ build.bat (working copy)
@@ -0,0 +1,25 @@
+@echo off
+
+setlocal ENABLEDELAYEDEXPANSION
+
+if "%JAVA_HOME%"=="" (
+ echo You must set JAVA_HOME to point at your Java Development Kit directory.
+ goto :eof
+)
+
+:: Add in your .jar files first
+for %%i in (lib\*.jar) do (
+ if "!CLASSPATH!"=="" (
+ set CLASSPATH=%%i
+ ) else (
+ set CLASSPATH=!CLASSPATH!;%%i
+ )
+)
+
+set BUILDFILE=build.xml
+
+"%JAVA_HOME%\bin\java" %ANT_OPTS% -classpath "%CLASSPATH%" ^
+ org.apache.tools.ant.Main ^
+ -Dant.home=%ANT_HOME% ^
+ -buildfile %BUILDFILE% ^
+ "%*"
Index: build.bat
===================================================================
--- build.bat (revision 1919032)
+++ build.bat (working copy)
@@ -1,30 +1,25 @@
-#!/bin/sh
+@echo off
-if [ "$JAVA_HOME" = "" ] ; then
+setlocal ENABLEDELAYEDEXPANSION
+
+if "%JAVA_HOME%"=="" (
echo You must set JAVA_HOME to point at your Java Development Kit directory.
- exit 1
-fi
+ goto :eof
+)
-# convert the existing path to unix
-if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
+:: Add in your .jar files first
+for %%i in (lib\*.jar) do (
+ if "!CLASSPATH!"=="" (
+ set CLASSPATH=%%i
+ ) else (
+ set CLASSPATH=!CLASSPATH!;%%i
+ )
+)
-# Add in your .jar files first
-for i in ./lib/*.jar
-do
- CLASSPATH=$CLASSPATH:"$i"
-done
+set BUILDFILE=build.xml
-# convert the unix path to windows
-if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
-fi
-
-BUILDFILE=build.xml
-
-"${JAVA_HOME}/bin/java" $ANT_OPTS -classpath "$CLASSPATH" \
- org.apache.tools.ant.Main \
- -Dant.home=$ANT_HOME \
- -buildfile ${BUILDFILE} \
- "$@"
+"%JAVA_HOME%\bin\java" %ANT_OPTS% -classpath "%CLASSPATH%" ^
+ org.apache.tools.ant.Main ^
+ -Dant.home=%ANT_HOME% ^
+ -buildfile %BUILDFILE% ^
+ "%*"