Skip to content

Commit

Permalink
Merge pull request #61 from ukanga/update-javarosa-v2.12.1
Browse files Browse the repository at this point in the history
Update javarosa v2.12.1
  • Loading branch information
yanokwa authored Dec 3, 2018
2 parents 7d4b04a + 6fed7d7 commit 669df89
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 110 deletions.
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ sourceCompatibility = '1.7'

dependencies {
compile group: 'net.sf.kxml', name: 'kxml2', version: '2.3.0'
compile group: 'org.opendatakit', name: 'opendatakit-javarosa', version: '2.11.1'
compile group: 'org.opendatakit', name: 'opendatakit-javarosa', version: '2.12.1'
compile group: 'org.slf4j', name: 'slf4j-nop', version: '1.7.25'
}

// Required to use fileExtensions property in checkstyle file
checkstyle {
toolVersion = '7.6.1'
toolVersion = '7.6.1'
}

ant.condition(property: 'os', value: 'windows') {
os(family: 'windows')
ant.condition(property: 'os', value: 'windows') {
os(family: 'windows')
}
ant.condition(property: 'os', value: 'unix' ) {
os(family: 'unix')
ant.condition(property: 'os', value: 'unix' ) {
os(family: 'unix')
}

// Use the result of git describe --tags --dirty as the version name
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
168 changes: 84 additions & 84 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
35 changes: 17 additions & 18 deletions src/org/opendatakit/validate/FormValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public class FormValidator implements ActionListener {
"org.javarosa.core.model.data.TimeData", // CoreModelModule
"org.javarosa.core.model.data.UncastData", // CoreModelModule
"org.javarosa.core.model.data.helper.BasicDataPointer", // CoreModelModule
"org.javarosa.core.model.Action", // CoreModelModule
"org.javarosa.core.model.actions.SetValueAction" //CoreModelModule
};

Expand Down Expand Up @@ -408,7 +407,7 @@ public void validate(InputStream xmlSource) {
errors.error("\n\n\n>> XML is invalid. See above for the errors.",e);
return;
}

// need a list of classes that formdef uses
// unfortunately, the JR registerModule() functions do more than this.
// register just the classes that would have been registered by:
Expand All @@ -418,11 +417,11 @@ public void validate(InputStream xmlSource) {
PrototypeManager.registerPrototypes(SERIALIABLE_CLASSES);
// initialize XForms module
new XFormsModule().registerModule();

// needed to override rms property manager
org.javarosa.core.services.PropertyManager
.setPropertyManager(new StubPropertyManager());

// validate if the xform can be parsed.
try {
FormDef fd = XFormUtils.getFormFromInputStream(new ByteArrayInputStream(xformData));
Expand All @@ -431,58 +430,58 @@ public void validate(InputStream xmlSource) {
errors.error("\n\n\n>> Something broke the parser. Try again.");
return;
}

// make sure properties get loaded
fd.getPreloader().addPreloadHandler(new FakePreloadHandler("property"));

// update evaluation context for function handlers
fd.getEvaluationContext().addFunctionHandler(new IFunctionHandler() {

public String getName() {
return "pulldata";
}

public List<Class[]> getPrototypes() {
return new ArrayList<Class[]>();
}

public boolean rawArgs() {
return true;
}

public boolean realTime() {
return false;
}

public Object eval(Object[] args, EvaluationContext ec) {
// no actual implementation here -- just a stub to facilitate validation
return args[0];
}});

// check for runtime errors
fd.initialize(true, new InstanceInitializationFactory());

errors.info("\n\n>> Xform parsing completed! See above for any warnings.\n");

// create FormEntryController from formdef
FormEntryModel fem = new FormEntryModel(fd);

// and try to step through the form...
if ( stepThroughEntireForm(fem) ) {
setError(true);
errors.error("\n\n>> Xform is invalid! See above for errors and warnings.");
} else {
errors.info("\n\n>> Xform is valid! See above for any warnings.");
}

} catch (XFormParseException e) {
setError(true);
errors.error("\n\n>> XForm is invalid. See above for the errors.",e);

} catch (Exception e) {
setError(true);
errors.error("\n\n>> Something broke the parser. See above for a hint.",e);

}

}
Expand Down

0 comments on commit 669df89

Please sign in to comment.