@@ -100,7 +100,6 @@ project.ext {
100
100
logger. info(" Unity NUnity framework found in $unity_nunit_dll_path " )
101
101
}
102
102
103
-
104
103
// xbuild is used to build the dlls.
105
104
xbuild_exe = findUnityPath(" XBUILD_EXE" , false ,
106
105
os_windows ?
@@ -115,6 +114,20 @@ project.ext {
115
114
logger. info(" xbuild found at $xbuild_exe " )
116
115
}
117
116
117
+ // nunit-console is used to run tests.
118
+ nunit_console_exe = findUnityPath(" NUNIT_CONSOLE_EXE" , false ,
119
+ os_windows ?
120
+ fileTree(dir : unity_root). matching { include ' **/Mono/bin/nunit-console2.bat' }
121
+ :
122
+ fileTree(dir : unity_root). matching { include ' **/Mono/bin/nunit-console2' }
123
+ )
124
+ if (nunit_console_exe == null || ! nunit_console_exe. exists()) {
125
+ logger. warn(" nunit_console command not found, compilation may fail." )
126
+ nunit_console_exe = null
127
+ } else {
128
+ logger. info(" nunit_console found at $nunit_console_exe " )
129
+ }
130
+
118
131
pluginSrc = file(' plugin' ). absolutePath
119
132
pluginProj = file(' build/PluginSrc' ). absolutePath
120
133
buildPath = file(' build' ). absolutePath
@@ -138,7 +151,7 @@ task compile_resolverTests(type: Exec) {
138
151
task test_resolverLib (type : Exec , dependsOn : compile_resolverTests) {
139
152
description ' Runs the tests.'
140
153
workingDir ' source'
141
- commandLine " nunit-console " ,
154
+ commandLine " $n unit_console_exe " ,
142
155
" JarResolverTests/bin/Debug/JarResolverTests.dll"
143
156
ext. remoteTaskPhase = ' build'
144
157
}
@@ -352,6 +365,8 @@ task export_package(dependsOn: 'generate_manifest') {
352
365
}
353
366
}
354
367
ext. remoteTaskPhase = ' build'
368
+
369
+ dependsOn test_resolverLib
355
370
}
356
371
357
372
task copy_plugin () {
0 commit comments