Commit 16bad813 authored by Calvin Metcalf's avatar Calvin Metcalf
Browse files

Refine it so the tests work and the structure is a better fit for AMD

parent dee5a694
Loading
Loading
Loading
Loading
+14 −33
Original line number Diff line number Diff line
module.exports = function(grunt) {
  grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		concat:{
			full:{
				src:[ './src/Proj4.js','./src/common.js','./src/Proj.js','./src/defs.js','src/defs/bigDefs.js','src/defs/smallDefs.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/util/MGRS.js'],
				dest:'./dist/proj4.js'
			},
			noDefs:{
				src:[ './src/Proj4.js','./src/common.js','./src/Proj.js','./src/defs.js','src/defs/smallDefs.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/defs/GOOGLE.js'],
				dest:'./dist/proj4-noDefs.js'
			}
		},
		uglify:{
			full:{
				src:[ './src/Proj4.js','./src/common.js','./src/Proj.js','./src/defs.js','src/defs/bigDefs.js','src/defs/smallDefs.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/util/MGRS.js'],
				dest:'./dist/proj4.min.js'
			},
			noDefs:{
				src:[ './src/Proj4.js','./src/common.js','./src/Proj.js','./src/defs.js','src/defs/smallDefs.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/defs/GOOGLE.js'],
				dest:'./dist/proj4-noDefs.min.js'
			}
		},
		connect: {
			server: {
				options: {
@@ -30,11 +10,17 @@ module.exports = function(grunt) {
			}
		},
		mocha_phantomjs: {
			all: {
			before: {
				options: {
					urls: [//my ide requries process.env.IP and PORT
						"http://"+(process.env.IP||"127.0.0.1")+":"+(process.env.PORT||"8080")+"/test/index.html"
					]
				}
			},
      after:{
        options: {
					urls: [//my ide requries process.env.IP and PORT
						"http://"+(process.env.IP||"127.0.0.1")+":"+(process.env.PORT||"8080")+"/test/index.html",
						"http://"+(process.env.IP||"127.0.0.1")+":"+(process.env.PORT||"8080")+"/test/min.html"
						"http://"+(process.env.IP||"127.0.0.1")+":"+(process.env.PORT||"8080")+"/test/opt.html"
					]
				}
			}
@@ -48,12 +34,12 @@ module.exports = function(grunt) {
				unused: true,
				trailing:true,
				indent:2,
        //camelcase:true,
        globals: {
          proj4: true
          define: true
        }
			},
			before: [ './src/Proj4.js','./src/Proj.js','./src/defs.js','./src/common.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/util/MGRS.js'],
      after: [ './dist/proj4.js']
			all: [ './src/*.js','./src/projCode/*.js','./src/defs/*.js']
		},
    requirejs: {
      compile: {
@@ -75,13 +61,8 @@ module.exports = function(grunt) {
	});
  grunt.loadNpmTasks('grunt-contrib-requirejs');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-mocha-phantomjs');
	grunt.registerTask('full', ['concat:full','uglify:full']);
	grunt.registerTask('noDefs', ['concat:noDefs','uglify:noDefs']);
	grunt.registerTask('test', ['connect', 'mocha_phantomjs']);
  grunt.registerTask('r', ['requirejs']);
	grunt.registerTask('default', ['jshint:before','full','noDefs','jshint:after','test']);
	grunt.registerTask('test', ['connect', 'mocha_phantomjs:before']);
  grunt.registerTask('default', ['jshint','test','requirejs','mocha_phantomjs:after']);
}
+1 −5
Original line number Diff line number Diff line
//The modules for your project will be inlined above
    //this snippet. Ask almond to synchronously require the
    //module value for 'main' here and return it as the
    //value to use for the public API for the built file.
  return require('proj4');
}));
 No newline at end of file

almond/start.frag.js

deleted100644 → 0
+0 −14
Original line number Diff line number Diff line
(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        //Allow using this built library as an AMD module
        //in another project. That other project will only
        //see this AMD call, not the internal modules in
        //the closure below.
        define(factory);
    } else {
        //Browser globals case. Just assign the
        //result to a property on the global.
        root.proj4 = factory();
    }
}(this, function () {
    //almond, and your modules will be inlined here
 No newline at end of file
+8 −14
Original line number Diff line number Diff line
(function (root, factory) {
  if (typeof define === 'function' && define.amd) {
        //Allow using this built library as an AMD module
        //in another project. That other project will only
        //see this AMD call, not the internal modules in
        //the closure below.
    define(factory);
  } else {
        //Browser globals case. Just assign the
        //result to a property on the global.
    root.proj4 = factory();
  }
}(this, function () {
    //almond, and your modules will be inlined here
 No newline at end of file
+79485 −5348

File changed.

Preview size limit exceeded, changes collapsed.

Loading