Commit 2ca296f0 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Migra a pdfjs ya compilado con viewer, adapta uso

Actualiza a última versión disponible de pdfjs en el nuevo package.

Limpia tareas de preparación de pdfjs, ya no hacen falta porque se
depende de un package npm donde ya se ha resuelto.

Redirige enlace simbólico y copia de recursos al construir para hacer
transparente para la app el cambio de ruta de la dependencia.
parent bf978e9d
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -3,10 +3,6 @@ module.exports = function(grunt) {
	var preBuildCmds = ['yarn install'];

	grunt.config('redmicConfig.buildModules', {
		'public/javascript/pdfjs': [
			'npm install',
			'gulp generic'
		],
		'public/javascript/pruneCluster': [
			'npm install',
			'grunt build:dist --force'
+5 −4
Original line number Diff line number Diff line
@@ -3,14 +3,15 @@ module.exports = function(grunt) {
	var srcPath = grunt.config('redmicConfig.srcPath'),
		distPath = grunt.config('redmicConfig.distPath'),
		publicPath = srcPath.split('/')[0],

		resourcesPath = 'resources/**',

		stylesPath = publicPath + '/stylesheets',
		stylesDistPath = stylesPath + '/dist',
		distStylesSubPath = distPath + '/stylesheets',

		pdfjsPath = '/javascript/pdfjs/',
		pdfjsBuildPath = 'build/generic/',
		srcPdfjsPath = publicPath + pdfjsPath + pdfjsBuildPath,
		srcPdfjsPath = publicPath + pdfjsPath,
		distPdfjsPath = distPath + pdfjsPath,
		pdfjsWebName = 'web',
		pdfjsBuildName = 'build';
@@ -35,12 +36,12 @@ module.exports = function(grunt) {
		pdfjs: {
			files: [{
				cwd: srcPdfjsPath + pdfjsWebName,
				src: ['v*[^.map]', 'images/*', 'locale/es-ES/*', 'locale/en-GB/*'],
				src: ['v*[^.map]', 'pdf.viewer.js', 'images/*', 'locale/es-ES/*', 'locale/en-GB/*'],
				dest: distPdfjsPath + pdfjsWebName,
				expand: true
			},{
				cwd: srcPdfjsPath + pdfjsBuildName,
				src: '*.js',
				src: 'pdf.worker.js',
				dest: distPdfjsPath + pdfjsBuildName,
				expand: true
			}]
+0 −16
Original line number Diff line number Diff line
@@ -16,20 +16,4 @@ module.exports = function(grunt) {
	grunt.config('uglify.dojoConfig', {
		files: [filesObj]
	});

	var pdfPath = path.join(destPath, 'pdfjs/'),
		pdfWebPath = pdfPath + 'web/',
		pdfBuiltPath = pdfPath + 'build/',
		pdfFilePath = pdfBuiltPath + 'pdf.js',
		pdfWorkerFilePath = pdfBuiltPath + 'pdf.worker.js',
		pdfViewerFilePath = pdfWebPath + 'viewer.js',
		filesPdfObj = {};

	filesPdfObj[pdfFilePath] = pdfFilePath;
	filesPdfObj[pdfWorkerFilePath] = pdfWorkerFilePath;
	filesPdfObj[pdfViewerFilePath] = pdfViewerFilePath;

	grunt.config('uglify.pdfjs', {
		files: [filesPdfObj]
	});
};
+1 −1
Original line number Diff line number Diff line
module.exports = function(grunt) {

	grunt.registerTask('build',
		['buildStyles', 'copy:resources', 'buildPdfjs', 'buildApp', 'packageApp']);
		['buildStyles', 'copy:resources', 'copy:pdfjs', 'buildApp', 'packageApp']);
};

grunt/task/buildPdfjs.js

deleted100644 → 0
+0 −7
Original line number Diff line number Diff line
module.exports = function(grunt) {

	grunt.registerTask('buildPdfjs', 'Añade pdfjs al compilado', function() {

		grunt.task.run(['copy:pdfjs', 'uglify:pdfjs']);
	});
};
Loading