summaryrefslogtreecommitdiffstats
path: root/poi-excelant
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2021-05-21 21:22:40 +0000
committerAndreas Beeker <kiwiwings@apache.org>2021-05-21 21:22:40 +0000
commit7eaca60a1a364ce6e232363d27823e971a992705 (patch)
tree718fc0e7ccd8c4ed50c2dcd579c4df10cc8b9581 /poi-excelant
parentcecab7f573f0cdf9ea74bedcf9b43dc535976e43 (diff)
downloadpoi-7eaca60a1a364ce6e232363d27823e971a992705.tar.gz
poi-7eaca60a1a364ce6e232363d27823e971a992705.zip
activate javadoc lint and fix errors
add signing and checksum generation add slf4j-bridge for tests add dependencies to ooxml-lite fix complex enum classes add override annotations move gradle logic to root build generate javadoc in its own dist directory, because JPMS complains about duplicate modules otherwise git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1890089 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-excelant')
-rw-r--r--poi-excelant/build.gradle57
-rw-r--r--poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java4
-rw-r--r--poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java37
3 files changed, 8 insertions, 90 deletions
diff --git a/poi-excelant/build.gradle b/poi-excelant/build.gradle
index 7d31dc74bc..2a6cb1403e 100644
--- a/poi-excelant/build.gradle
+++ b/poi-excelant/build.gradle
@@ -47,6 +47,7 @@ dependencies {
testImplementation project(path: ':poi-ooxml', configuration: 'tests')
testImplementation project(path: ':poi-scratchpad', configuration: 'tests')
testImplementation 'com.google.guava:guava:30.0-jre'
+ testImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.1'
}
final String MODULE_NAME = 'org.apache.poi.excelant'
@@ -60,13 +61,6 @@ final String OOXML_LITE_REPORT = '../build/ooxml-lite-report'
final String OOXML_LITE_JAR = "../build/dist/maven/poi-ooxml-lite/poi-ooxml-lite-${project.version}.jar"
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
-java {
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
- withJavadocJar()
- withSourcesJar()
-}
-
task compileJava9(type: JavaCompile) {
dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
@@ -146,18 +140,6 @@ task testJar(type: Jar, dependsOn: testClasses) {
}
}
-sourcesJar {
- destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
-}
-
-javadoc {
-// fails currently, need to fix the sources
- failOnError = false
-// if(JavaVersion.current().isJava9Compatible()) {
-// options.addBooleanOption('html5', true)
-// }
-}
-
artifacts {
tests testJar
}
@@ -165,40 +147,13 @@ artifacts {
test {
dependsOn { testJar }
- useJUnitPlatform()
-
doFirst {
- jvmArgs = [
- '-Djava.io.tmpdir=build',
- '-DPOI.testdata.path=../test-data',
- '-Djava.awt.headless=true',
- '-Djava.locale.providers=JRE,CLDR',
- '-Duser.language=en',
- '-Duser.country=US',
- '-Djavax.xml.stream.XMLInputFactory=com.sun.xml.internal.stream.XMLInputFactoryImpl',
- "-Dversion.id=${project.version}",
- '-ea',
+ jvmArgs += [
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
- '-Djunit.jupiter.execution.parallel.enabled=true',
- '-Djunit.jupiter.execution.parallel.config.strategy=fixed',
- '-Djunit.jupiter.execution.parallel.config.fixed.parallelism=3'
- // -Xjit:verbose={compileStart|compileEnd},vlog=build/jit.log${no.jit.sherlock} ... if ${isIBMVM}
]
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
jvmArgs += [
- '-Dsun.reflect.debugModuleAccessChecks=true',
- '-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
- '--illegal-access=warn',
-
'--add-modules', MODULE_NAME,
-
- // see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
- // opposed to the recommendation there, it doesn't work to add ... to the dependencies
- // testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.7.1'
- // gradles gradle-worker.jar is still not a JPMS module and thus runs as unnamed module
- '--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED',
- '--add-exports','org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED',
-
'--module-path', '../build/dist/maven/poi-excelant-tests:' + files(TEST_MODULE_PATH).asPath,
]
}
@@ -208,16 +163,10 @@ test {
publishing {
publications {
POI(MavenPublication) {
- artifactId project.archivesBaseName
-
- from components.java
-
pom {
- name = 'Apache POI - API based on OPC and OOXML schemas'
+ name = 'Apache POI - ExcelAnt'
description = 'Apache POI - Java API To Access Microsoft Format Files'
}
}
}
}
-
-generatePomFileForPOIPublication.destination = "../build/dist/maven/${project.archivesBaseName}/${project.archivesBaseName}-${project.version}.pom"
diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java
index 23c2583da8..b2f9266d76 100644
--- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java
+++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java
@@ -23,7 +23,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
/**
- * This is the class that backs the <handler> tag in the Ant task.
+ * This is the class that backs the {@code <handler>} tag in the Ant task.
* <p>
* Its purpose is to provide a way to manipulate a workbook in the course
* of an ExcelAnt task. The idea being to model a way for test writers to
@@ -36,7 +36,7 @@ import org.apache.tools.ant.Task;
* class you write to manipulate the workbook.
* <p>
* In order to use this tag you must write a class that implements the
- * <code>IExcelAntWorkbookHandler</code> interface. After writing the
+ * {@code IExcelAntWorkbookHandler} interface. After writing the
* class you should package it and it's dependencies into a jar file to
* add as library in your Ant build file.
*/
diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java
index 69616c5310..0bb0cb2ec2 100644
--- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java
+++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java
@@ -187,8 +187,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* Returns the Workbook instance associated with this WorkbookUtil.
- *
- * @return
*/
public Workbook getWorkbook() {
return workbook;
@@ -197,8 +195,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* Returns the fileName that was used to initialize this instance. May
* return null if the instance was constructed from a Workbook object.
- *
- * @return
*/
public String getFileName() {
return excelFileName;
@@ -206,8 +202,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* Returns the list of sheet names.
- *
- * @return
*/
public List<String> getSheets() {
ArrayList<String> sheets = new ArrayList<>();
@@ -224,9 +218,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* This method uses a String in standard Excel format (SheetName!CellId) to
* locate the cell and set it to the value of the double in value.
- *
- * @param cellName
- * @param value
*/
public void setDoubleValue(String cellName, double value) {
log("starting setCellValue()", Project.MSG_DEBUG);
@@ -240,9 +231,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* Utility method for setting the value of a Cell with a String.
- *
- * @param cellName
- * @param value
*/
public void setStringValue(String cellName, String value) {
Cell cell = getCell(cellName);
@@ -251,9 +239,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* Utility method for setting the value of a Cell with a Formula.
- *
- * @param cellName
- * @param formula
*/
public void setFormulaValue(String cellName, String formula) {
Cell cell = getCell(cellName);
@@ -262,8 +247,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* Utility method for setting the value of a Cell with a Date.
- * @param cellName
- * @param date
*/
public void setDateValue(String cellName, Date date) {
Cell cell = getCell(cellName);
@@ -272,15 +255,11 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* Uses a String in standard Excel format (SheetName!CellId) to locate a
* cell and evaluate it.
- *
- * @param cellName
- * @param expectedValue
- * @param precision
*/
public ExcelAntEvaluationResult evaluateCell(String cellName, double expectedValue,
double precision) {
- ExcelAntEvaluationResult evalResults = null;
+ ExcelAntEvaluationResult evalResults;
Cell cell = getCell(cellName);
@@ -304,12 +283,11 @@ public class ExcelAntWorkbookUtil extends Typedef {
"Evaluation passed without error within in range.", delta, cellName);
}
} else {
- String errorMeaning = null;
+ String errorMeaning;
try {
errorMeaning = FormulaError.forInt(resultOfEval.getErrorValue()).getString();
} catch(IllegalArgumentException iae) {
- errorMeaning = "unknown error code: " +
- Byte.toString(resultOfEval.getErrorValue());
+ errorMeaning = "unknown error code: " + resultOfEval.getErrorValue();
}
evalResults = new ExcelAntEvaluationResult(true, false,
@@ -325,9 +303,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* Returns a Cell as a String value.
- *
- * @param cellName
- * @return
*/
public String getCellAsString(String cellName) {
Cell cell = getCell(cellName);
@@ -337,9 +312,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
/**
* Returns the value of the Cell as a double.
- *
- * @param cellName
- * @return
*/
public double getCellAsDouble(String cellName) {
Cell cell = getCell(cellName);
@@ -349,9 +321,6 @@ public class ExcelAntWorkbookUtil extends Typedef {
* Returns a cell reference based on a String in standard Excel format
* (SheetName!CellId). This method will create a new cell if the
* requested cell isn't initialized yet.
- *
- * @param cellName
- * @return
*/
private Cell getCell(String cellName) {
CellReference cellRef = new CellReference(cellName);