Commit 06c446ad authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Elimina rutas relativas de dojoConfig

Trata de la misma manera las rutas de dojoConfig, tanto para la versión
de desarrollo, como la de testeo y la de compilado (adaptando la
ruta base), haciendo uso de 'baseUrl' en el propio fichero.

Aplica corrección necesaria sólo para tests funcionales, añadiendo
prefijo de directorio actual ('.') a 'baseUrl' en este caso.

Define de manera estática la ruta de 'test' en dojoConfig de desarrollo,
en lugar de añadirlo dinámicamente al ejecutar, ya que no hace daño
tenerlo predefinido.
parent c5af0208
Loading
Loading
Loading
Loading
+42 −37
Original line number Diff line number Diff line
dojoConfig = {
	baseUrl: '/client-app',

	packages: [{
		name: 'src',
		location: '../../src'
		location: 'src'
	},{
		name: 'test',
		location: 'test'
	},{
		name: 'app',
		location: '../../src/oldapp'
		location: 'src/oldapp'
	},{
		name: 'RWidgets',
		location: '../../src/util/widgets'
		location: 'src/util/widgets'
	},{
		name: 'dojo',
		location: '../dojo'
		location: 'dep/dojo'
	},{
		name: 'dijit',
		location: '../dijit'
		location: 'dep/dijit'
	},{
		name: 'dojox',
		location: '../dojox'
		location: 'dep/dojox'
	},{
		name: 'put-selector',
		location: '../put-selector'
		location: 'dep/put-selector'
	},{
		name: 'alertify',
		location: '../alertify/build'
		location: 'dep/alertify/build'
	},{
		name: 'dropzone',
		location: '../dropzone/dist/min'
		location: 'dep/dropzone/dist/min'
	},{
		name: 'leaflet',
		location: '../leaflet/dist'
		location: 'dep/leaflet/dist'
	},{
		name: 'L-draw',
		location: '../leaflet-draw/dist'
		location: 'dep/leaflet-draw/dist'
	},{
		name: 'L-miniMap',
		location: '../leaflet-minimap/dist'
		location: 'dep/leaflet-minimap/dist'
	},{
		name: 'L-coordinates',
		location: '../leaflet-coordinates/dist'
		location: 'dep/leaflet-coordinates/dist'
	},{
		name: 'L-navBar',
		location: '../leaflet-nav'
		location: 'dep/leaflet-nav'
	},{
		name: 'L-areaselect',
		location: '../leaflet-areaselect/src'
		location: 'dep/leaflet-areaselect/src'
	},{
		name: 'd3',
		location: '../d3/dist'
		location: 'dep/d3/dist'
	},{
		name: 'd3Tip',
		location: '../d3-v6-tip/build'
		location: 'dep/d3-v6-tip/build'
	},{
		name: 'tv4',
		location: '../tv4'
		location: 'dep/tv4'
	},{
		name: 'mediatorjs',
		location: '../mediatorjs'
		location: 'dep/mediatorjs'
	},{
		name: 'cbtree',
		location: '../cbtree'
		location: 'dep/cbtree'
	},{
		name: 'proj4',
		location: '../proj4/dist'
		location: 'dep/proj4/dist'
	},{
		name: 'handlebars',
		location: '../handlebars/dist'
		location: 'dep/handlebars/dist'
	},{
		name: 'awesome-markers',
		location: '../leaflet.awesome-markers/dist'
		location: 'dep/leaflet.awesome-markers/dist'
	},{
		name: 'pruneCluster',
		location: '../pruneCluster/dist'
		location: 'dep/pruneCluster/dist'
	},{
		name: 'templates',
		location: '../templates/dist'
		location: 'dep/templates/dist'
	},{
		name: 'packery',
		location: '../packery/dist'
		location: 'dep/packery/dist'
	},{
		name: 'draggabilly',
		location: '../draggabilly/dist'
		location: 'dep/draggabilly/dist'
	},{
		name: 'moment',
		location: '../moment/min'
		location: 'dep/moment/min'
	},{
		name: 'leaflet-measure',
		location: '../leaflet-measure/dist'
		location: 'dep/leaflet-measure/dist'
	},{
		name: 'sockjs',
		location: '../sockjs/dist'
		location: 'dep/sockjs/dist'
	},{
		name: 'stomp-websocket',
		location: '../stomp-websocket/lib'
		location: 'dep/stomp-websocket/lib'
	},{
		name: 'deepmerge',
		location: '../deepmerge/dist'
		location: 'dep/deepmerge/dist'
	},{
		name: 'colorjs',
		location: '../color-js'
		location: 'dep/color-js'
	},{
		name: 'uuid',
		location: '../uuid/dist/umd'
		location: 'dep/uuid/dist/umd'
	},{
		name: 'json-schema-ref-parser',
		location: '../json-schema-ref-parser/dist'
		location: 'dep/json-schema-ref-parser/dist'
	},{
		name: 'leaflet-nontiledlayer',
		location: '../leaflet-nontiledlayer/dist'
		location: 'dep/leaflet-nontiledlayer/dist'
	},{
		name: 'wicket',
		location: '../wicket'
		location: 'dep/wicket'
	}],

	map: {
+12 −10
Original line number Diff line number Diff line
@@ -2,36 +2,38 @@ dojoConfig = {
	locale: typeof lang !== 'undefined' ? lang : 'es',
	extraLocale: ['en'],

	baseUrl: '/client-app/dist/js',

	packages: [{
		name: 'app',
		location: '../app'
		location: 'app'
	},{
		name: 'src',
		location: '../src'
		location: 'src'
	},{
		name: 'dojo',
		location: '../dojo'
		location: 'dojo'
	},{
		name: 'dojox',
		location: '../dojox'
		location: 'dojox'
	},{
		name: 'json-schema-ref-parser',
		location: '../json-schema-ref-parser'
		location: 'json-schema-ref-parser'
	},{
		name: 'packery',
		location: '../packery'
		location: 'packery'
	},{
		name: 'draggabilly',
		location: '../draggabilly'
		location: 'draggabilly'
	},{
		name: 'colorjs',
		location: '../colorjs'
		location: 'colorjs'
	},{
		name: 'd3',
		location: '../d3'
		location: 'd3'
	},{
		name: 'leaflet-measure',
		location: '../leaflet-measure'
		location: 'leaflet-measure'
	}],

	map: {
+4 −7
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ module.exports = function(args) {
		path = require('path'),

		srcPath = args.srcPath,
		dojoBaseUrl = args.dojoBaseUrl,
		dojoBaseUrlPrefix = args.dojoBaseUrlPrefix,

		dojoConfigFileName = 'dojoConfig.js',
		dojoConfigFileContent = fs.readFileSync(path.join(srcPath, dojoConfigFileName), 'utf8'),
@@ -21,12 +21,9 @@ module.exports = function(args) {
		dojoConfigStringValue = dojoConfigContentRegex.exec(dojoConfigFileContent)[1],
		dojoConfig = _stringToJson(dojoConfigStringValue);

	dojoConfig.baseUrl = dojoBaseUrl;

	dojoConfig.packages.push({
		name: 'test',
		location: '../../test'
	});
	if (dojoBaseUrlPrefix) {
		dojoConfig.baseUrl = dojoBaseUrlPrefix + dojoConfig.baseUrl
	};

	return dojoConfig;
};
+0 −6
Original line number Diff line number Diff line
@@ -9,12 +9,6 @@

	<body class="db">
		<script src="/client-app/src/dojoConfig.js"></script>
		<script>
			dojoConfig.packages.push({
				name: 'test',
				location: '../../test'
			});
		</script>
		<script src="/client-app/dep/dojo/dojo.js"></script>

		<div style="margin: 20px; height: calc(100% - 40px)">
+2 −5
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ module.exports = function(grunt) {

			rootPath = grunt.config('redmicConfig.rootPath'),
			srcPath = grunt.config('redmicConfig.srcPath'),
			depPath = grunt.config('redmicConfig.depPath'),
			testPath = grunt.config('redmicConfig.testPath'),
			outputPath = 'test_reports',

@@ -87,7 +86,6 @@ module.exports = function(grunt) {
			testUnitRemotePath = path.join(absoluteTestsPath, 'intern-unit-remote'),
			testFunctionalLocalPath = path.join(absoluteTestsPath, 'intern-functional-local'),
			testFunctionalRemotePath = path.join(absoluteTestsPath, 'intern-functional-remote'),
			dojoCommonBaseUrl = path.join(' ', depPath, '*').trim(),

			ipGetterPath = path.join(absoluteTestsPath, 'IpGetter'),
			IpGetter = require(ipGetterPath)(),
@@ -117,8 +115,7 @@ module.exports = function(grunt) {
			testUnitParams = deepmerge(testParams, {
				reporters: unitReporters,
				suites: suites,
				coverage: coverage,
				dojoBaseUrl: dojoCommonBaseUrl
				coverage: coverage
			}),
			testFunctionalParams = deepmerge(testParams, {
				serverUrl: serverUrl,
@@ -128,7 +125,7 @@ module.exports = function(grunt) {
				reporters: functionalReporters,
				functionalSuites: functionalSuites,
				reportersOutputPath: reportersOutputPath,
				dojoBaseUrl: '.' + dojoCommonBaseUrl
				dojoBaseUrlPrefix: '.'
			}),

			testUnitLocalOptions = require(testUnitLocalPath)(testUnitParams),