Skip to content
Permalink
Browse files
Remove javadoc from custom build script
  • Loading branch information
davecromberge committed Sep 7, 2021
1 parent 49d187e commit 6b3a9bd9b97ceda36e5633ac652c8c90f37e0087
Showing 2 changed files with 5 additions and 22 deletions.
@@ -165,10 +165,9 @@ The build script performs the following steps:

1. Sets up staging directories under **target/** for the package files
2. Uses git commands to gather information about the current Git commit and branch
3. Compiles java source tree and assembles javadocs
3. Compiles java source tree
4. Packages a JAR containing compiled sources together with the Manifest, Licence and Notice files
5. Packages a javadoc JAR containing documentation files together with the Manifest, Licence and Notice files
6. Checks and tests the assembled JAR by using the API to access four different resource types
5. Checks and tests the assembled JAR by using the API to access four different resource types

The build script is located in the **tools/scripts/** directory and requires the following arguments:

@@ -51,15 +51,12 @@ MemoryMapFile=$ScriptsDir/LoremIpsum.txt
#### Initialise path dependent variables ####
OutputDir=target
OutputJar=${OutputDir}/org.apache.datasketches.memory-${GitTag}.jar
OutputDocsJar=${OutputDir}/org.apache.datasketches.memory-${GitTag}-javadoc.jar

PackageDir=${OutputDir}/package
PackageSrc=${PackageDir}/src
PackageTests=${PackageDir}/test-classes
PackageContents=${PackageDir}/contents
PackageDocs=${PackageDir}/javadoc
PackageMeta=${PackageContents}/META-INF
PackageDocsMeta=${PackageDocs}/META-INF
PackageManifest=${PackageMeta}/MANIFEST.MF

MemoryJava8Src=datasketches-memory-java8/src/main/java
@@ -73,7 +70,6 @@ cd ${ProjectBaseDir}
if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/java" ]]; then Java_="${JDKHome}/bin/java"; else echo "No java version could be found."; exit 1; fi
if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/javac" ]]; then Javac_="${JDKHome}/bin/javac"; else echo "No javac version could be found."; exit 1; fi
if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/jar" ]]; then Jar_="${JDKHome}/bin/jar"; else echo "No jar version could be found."; exit 1; fi
if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/javadoc" ]]; then Javadoc_="${JDKHome}/bin/javadoc"; else echo "No javadoc version could be found."; exit 1; fi

#### Parse java -version into major version number ####
if [[ "$Java_" ]]; then
@@ -99,11 +95,10 @@ mkdir -p $PackageSrc
mkdir -p $PackageTests
mkdir -p $PackageContents
mkdir -p $PackageMeta
mkdir -p $PackageDocsMeta

#### Copy LICENSE and NOTICE ####
cp LICENSE $PackageMeta; cp LICENSE $PackageDocsMeta;
cp NOTICE $PackageMeta; cp NOTICE $PackageDocsMeta;
cp LICENSE $PackageMeta
cp NOTICE $PackageMeta

#### Generate MANIFEST.MF ####
cat >> ${PackageManifest}<< EOF
@@ -114,7 +109,6 @@ EOF

#### Generate git.properties file ####
echo "$($ScriptsDir/getGitProperties.sh $ProjectBaseDir $ProjectArtifactId $GitTag)" >> $PackageManifest
cp $PackageManifest $PackageDocsMeta

#### Copy source tree to target/src
rsync -a -I $MemoryJava8Src $PackageSrc
@@ -128,39 +122,30 @@ elif [[ $JavaVersion -gt 10 ]]; then
rsync -a -I $MemoryJava11Src $PackageSrc
fi

#### Compile and create docs ####
#### Compile ####
echo "--- CLEAN & COMPILE ---"
echo
echo "Compiling with JDK version $JavaVersion..."
if [[ $JavaVersion -lt 9 ]]; then
${Javac_} -d $PackageContents $(find $PackageSrc -name '*.java')
${Javadoc_} -quiet -d $PackageDocs $(find $PackageSrc -name '*.java')
else
# Compile with JPMS exports
${Javac_} \
--add-exports java.base/jdk.internal.ref=org.apache.datasketches.memory \
--add-exports java.base/sun.nio.ch=org.apache.datasketches.memory \
-d $PackageContents $(find $PackageSrc -name '*.java')
# Compile Javadoc with JPMS exports
${Javadoc_} \
--add-exports java.base/jdk.internal.ref=org.apache.datasketches.memory \
--add-exports java.base/sun.nio.ch=org.apache.datasketches.memory \
-quiet -d $PackageDocs $(find $PackageSrc -name '*.java')
fi
echo
echo "--- JARS ---"
echo
echo "Building JAR from ${PackageContents}..."
${Jar_} cf $OutputJar -C $PackageContents .
echo "Building Javadoc JAR from ${PackageDocs}..."
${Jar_} cf $OutputDocsJar -C $PackageDocs .
echo

# Uncomment this section to display JAR contents
# echo "--- JAR CONTENTS ---"
# echo
# ${Jar_} tf ${OutputJar}
# ${Jar_} tf ${OutputDocsJar}
# echo

echo "--- RUN JAR CHECKS ---"
@@ -183,4 +168,3 @@ else
fi
echo
echo "Successfully built ${OutputJar}"
echo "Successfully built ${OutputDocsJar}"

0 comments on commit 6b3a9bd

Please sign in to comment.