Skip to content

Commit 1ba9710

Browse files
committed
Added output to the shell script. Testing it in reference.php
1 parent ef5adf9 commit 1ba9710

File tree

2 files changed

+43
-14
lines changed

2 files changed

+43
-14
lines changed

generate/reference.php

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,51 @@
22

33
require_once('../config.php');
44

5+
function out($output) {
6+
echo "<p>$output</p>";
7+
error_log($output);
8+
}
9+
10+
$JAVA_HOME = "/usr/local/jdk1.5.0_15";
11+
$PATH = "$JAVA_HOME/bin:/usr/local/bin:/usr/bin:/bin";
12+
putenv("JAVA_HOME=$JAVA_HOME");
13+
putenv("PATH=$PATH");
14+
515
$benchmark_start = microtime_float();
616

717
$path = BASEDIR; //define('BASEDIR', dirname(__FILE__).'/');
818

919
// Pull latest processing/processing from GitHub
1020
// Note that the Reference generate script needs this,
1121
// just in case someone changed anything in the .java source files.
12-
echo '<p>Pulling in latest changes from processing/processing/...</p>';
22+
out("Pulling in latest changes from processing/processing/...");
23+
1324
$mainRepoPath = $path . '../processing';
14-
`cd $mainRepoPath && /usr/bin/git pull https://github.com/processing/processing/`;
25+
$shell_output = shell_exec("cd $mainRepoPath && /usr/bin/git pull https://github.com/processing/processing-docs/ 2>&1");
26+
27+
out($shell_output);
28+
29+
//exec("cd $mainRepoPath && /usr/bin/git pull https://github.com/processing/processing/");
1530

1631
// Pull latest processing/processing-docs from GitHub
1732
echo '<p>Pulling in latest changes from processing/processing-docs/...</p>';
1833
`cd $path && /usr/bin/git pull https://github.com/processing/processing-docs/`;
1934

35+
out("---------------");
36+
2037
$referencepath = $path . "java_generate/ReferenceGenerator/";
2138

2239
//
23-
echo '<p>Rebuilding reference files...</p>';
24-
`cd $referencepath && ./processingrefBuild.sh`;
40+
41+
out("Rebuilding reference files...");
42+
43+
$shell_output = shell_exec("cd $referencepath && ./processingrefBuild.sh 2>&1");
44+
45+
out($shell_output);
2546

2647
$benchmark_end = microtime_float();
2748
$execution_time = round($benchmark_end - $benchmark_start, 4);
2849

29-
?>
30-
3150

32-
<p>Generated files in <?=$execution_time?> seconds.</p>
51+
out("Generated files in $execution_time seconds.");
52+
?>

java_generate/ReferenceGenerator/processingrefBuild.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
#!/bin/sh
22

3+
echo "[REFERENCE GENERATOR] Booting up..."
4+
35
# PROCESSING_SRC_PATH=./test
46
PROCESSING_SRC_PATH=../../../processing/core/src
57
PROCESSING_LIB_PATH=../../../processing/java/libraries
68
# GENERATE REFERENCE ENTRIES AND INDEX THROUGH JAVADOC - BY DAVID WICKS
79

8-
#remove everything old
10+
echo "[REFERENCE GENERATOR] Source Path :: $PROCESSING_SRC_PATH"
11+
echo "[REFERENCE GENERATOR] Library Path :: $PROCESSING_LIB_PATH"
12+
13+
14+
echo "[REFERENCE GENERATOR] Removing previous version of the ref..."
915
rm -rf ../../reference
1016
mkdir ../../reference
1117
rm -rf ../../distribution
1218
mkdir ../../distribution
1319

14-
#generate everything anew
20+
echo "[REFERENCE GENERATOR] Generating new javadocs..."
1521
javadoc -doclet ProcessingWeblet \
1622
-docletpath bin/ \
1723
-public \
@@ -33,20 +39,20 @@ javadoc -doclet ProcessingWeblet \
3339
$PROCESSING_LIB_PATH/serial/src/processing/serial/*.java \
3440
$PROCESSING_LIB_PATH/../../../processing-video/src/processing/video/*.java \
3541
-noisy
36-
# ./test/seetags.java \
3742

3843

39-
# COPY IMAGES FROM CONTENT FOLDER TO CORRECT FOLDERS
4044

41-
# manage web reference
45+
echo "[REFERENCE GENERATOR] Copying images from content directory to the correct location..."
46+
47+
echo "[REFERENCE GENERATOR] Updating web paths..."
4248
cp -R ../../css ../../reference/
4349
cp -R ../../javascript ../../reference/
4450
mkdir -p ../../reference/images
4551
cp -R ../../content/api_media/*.jpg ../../reference/images/
4652
cp -R ../../content/api_media/*.gif ../../reference/images/
4753
cp -R ../../content/api_media/*.png ../../reference/images/
4854

49-
# manage local reference
55+
echo "[REFERENCE GENERATOR] Updating local reference paths..."
5056
cp -R ../../css ../../distribution/
5157
cp -R ../../javascript ../../distribution/
5258
rm -rf ../../distribution/css/fonts/TheSerif_B4_Bold_.eot
@@ -62,10 +68,11 @@ cp -R ../../content/api_media/*.png ../../distribution/images/
6268

6369

6470
# COPY IMAGES
65-
71+
echo "[REFERENCE GENERATOR] Copying images to web reference..."
6672
# copy images for web reference isn't needed because they are already on server
6773

6874
# copy images for local reference
75+
echo "[REFERENCE GENERATOR] Copying images to local reference..."
6976
mkdir -p ../../distribution/img
7077
chmod 755 ../../distribution/img
7178
mkdir -p ../../distribution/img/about/
@@ -85,6 +92,7 @@ cp ../../content/api_en/images/header.gif ../../distribution/img/
8592
cd ../../generate/
8693

8794
# run web reference creations files
95+
echo "[REFERENCE GENERATOR] Running PHP to generate static files..."
8896
php staticpages.php
8997
php tools.php
9098
php libraries.php
@@ -97,6 +105,7 @@ php libraries_local.php
97105
php environment_local.php
98106

99107
# add the links to load in the libraries and tools lists online
108+
echo "[REFERENCE GENERATOR] Generating symlinks for web libraries and tools..."
100109
cd ../reference/libraries/
101110
ln -s index.html index.shtml
102111
cd ../tools/

0 commit comments

Comments
 (0)