@@ -603,28 +603,19 @@ gruntConfig = {
603603 Rule .copyLibs
604604 npmLibNames : [' freedom-for-chrome' ]
605605 pathsFromDevBuild : [' lib/churn-pipe' , ' lib/loggingprovider' , ' lib/zork' ]
606- pathsFromThirdPartyBuild : [
607- ' uproxy-obfuscators' ,
608- ' freedom-port-control'
609- ]
606+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
610607 localDestPath : ' lib/samples/zork-chromeapp/'
611608 libsForZorkFirefoxApp :
612609 Rule .copyLibs
613610 npmLibNames : [' freedom-for-firefox' ]
614611 pathsFromDevBuild : [' lib/churn-pipe' , ' lib/loggingprovider' , ' lib/zork' ]
615- pathsFromThirdPartyBuild : [
616- ' uproxy-obfuscators' ,
617- ' freedom-port-control'
618- ]
612+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
619613 localDestPath : ' lib/samples/zork-firefoxapp/data/'
620614 libsForZorkNode :
621615 Rule .copyLibs
622616 npmLibNames : [' freedom-for-node' ]
623617 pathsFromDevBuild : [' lib/churn-pipe' , ' lib/loggingprovider' , ' lib/zork' ]
624- pathsFromThirdPartyBuild : [
625- ' uproxy-obfuscators' ,
626- ' freedom-port-control'
627- ]
618+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
628619 localDestPath : ' lib/samples/zork-node/'
629620
630621 libsForEchoServerChromeApp :
@@ -642,25 +633,19 @@ gruntConfig = {
642633 Rule .copyLibs
643634 npmLibNames : [' freedom-for-chrome' ]
644635 pathsFromDevBuild : [' lib/copypaste-chat' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
645- pathsFromThirdPartyBuild : [
646- ' freedom-port-control'
647- ]
636+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
648637 localDestPath : ' lib/samples/copypaste-chat-chromeapp/'
649638 libsForCopypasteChatFirefoxApp :
650639 Rule .copyLibs
651640 npmLibNames : [' freedom-for-firefox' ]
652641 pathsFromDevBuild : [' lib/copypaste-chat' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
653- pathsFromThirdPartyBuild : [
654- ' freedom-port-control'
655- ]
642+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
656643 localDestPath : ' lib/samples/copypaste-chat-firefoxapp/data'
657644 libsForCopypasteChatWebApp :
658645 Rule .copyLibs
659646 npmLibNames : [' freedom' ]
660647 pathsFromDevBuild : [' lib/copypaste-chat' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
661- pathsFromThirdPartyBuild : [
662- ' freedom-port-control'
663- ]
648+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
664649 localDestPath : ' lib/samples/copypaste-chat-webapp/'
665650
666651 libsForCopyPasteSocksChromeApp :
@@ -670,7 +655,6 @@ gruntConfig = {
670655 ]
671656 pathsFromDevBuild : [' lib/copypaste-socks' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
672657 pathsFromThirdPartyBuild : [
673- ' uproxy-obfuscators'
674658 ' i18n'
675659 ' bower/polymer'
676660 ' freedom-pgp-e2e'
@@ -684,7 +668,6 @@ gruntConfig = {
684668 ]
685669 pathsFromDevBuild : [' lib/copypaste-socks' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
686670 pathsFromThirdPartyBuild : [
687- ' uproxy-obfuscators'
688671 ' i18n'
689672 ' bower'
690673 ' freedom-pgp-e2e'
@@ -696,19 +679,13 @@ gruntConfig = {
696679 Rule .copyLibs
697680 npmLibNames : [' freedom-for-chrome' ]
698681 pathsFromDevBuild : [' lib/simple-socks' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
699- pathsFromThirdPartyBuild : [
700- ' uproxy-obfuscators'
701- ' freedom-port-control'
702- ]
682+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
703683 localDestPath : ' lib/samples/simple-socks-chromeapp/'
704684 libsForSimpleSocksFirefoxApp :
705685 Rule .copyLibs
706686 npmLibNames : [' freedom-for-firefox' ]
707687 pathsFromDevBuild : [' lib/simple-socks' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
708- pathsFromThirdPartyBuild : [
709- ' uproxy-obfuscators'
710- ' freedom-port-control'
711- ]
688+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
712689 localDestPath : ' lib/samples/simple-socks-firefoxapp/data/'
713690 libsForSimpleSocksNode :
714691 Rule .copyLibs
@@ -724,17 +701,13 @@ gruntConfig = {
724701 Rule .copyLibs
725702 npmLibNames : [' freedom-for-chrome' ]
726703 pathsFromDevBuild : [' lib/simple-chat' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
727- pathsFromThirdPartyBuild : [
728- ' freedom-port-control'
729- ]
704+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
730705 localDestPath : ' lib/samples/simple-chat-chromeapp/'
731706 libsForSimpleChatFirefoxApp :
732707 Rule .copyLibs
733708 npmLibNames : [' freedom-for-firefox' ]
734709 pathsFromDevBuild : [' lib/simple-chat' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
735- pathsFromThirdPartyBuild : [
736- ' freedom-port-control'
737- ]
710+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
738711 localDestPath : ' lib/samples/simple-chat-firefoxapp/data'
739712 # While neither churn-pipe nor freedom-port-control can be used in a
740713 # regular web page environment, they are included so that obfuscation
@@ -743,9 +716,7 @@ gruntConfig = {
743716 Rule .copyLibs
744717 npmLibNames : [' freedom' ]
745718 pathsFromDevBuild : [' lib/simple-chat' , ' lib/churn-pipe' , ' lib/loggingprovider' ]
746- pathsFromThirdPartyBuild : [
747- ' freedom-port-control'
748- ]
719+ pathsFromThirdPartyBuild : [' freedom-port-control' ]
749720 localDestPath : ' lib/samples/simple-chat-webapp/'
750721
751722 libsForUprobeChromeApp :
@@ -811,52 +782,25 @@ gruntConfig = {
811782 ' freedom-social-wechat' : ' <%= pkgs.freedomwechat.version %>'
812783 ' freedom-social-quiver' : ' <%= pkgs.freedomquiver.version %>'
813784 }]
814- # -------------------------------------------------------------------------
815- # All typescript compiles to locations in `build/`
816- # Typescript compilation rules
785+
786+ # One pass for code running inside freedom.js modules and another
787+ # for code running outside, due to the differences in the meaning
788+ # of the (global) freedom object between the two environments.
817789 ts :
818- # Compile all non-sample typescript code into the development build
819- # directory.
820- devInModuleEnv : compileTypescript [
821- devBuildPath + ' /lib/**/*.ts'
822- devBuildPath + ' /interfaces/**/*.ts'
823- devBuildPath + ' /generic_core/**/*.ts'
790+ moduleEnv : compileTypescript [
791+ devBuildPath + ' /**/*.ts'
824792 ' !' + devBuildPath + ' /lib/build-tools/**/*.ts'
793+ ' !' + devBuildPath + ' /integration/**/*.ts'
825794 ' !' + devBuildPath + ' /**/*.core-env.ts'
826795 ' !' + devBuildPath + ' /**/*.core-env.spec.ts'
827796 ]
828-
829- generic_ui : compileTypescript [
830- devBuildPath + ' /generic_ui/**/*.ts'
831- devBuildPath + ' /**/*.core-env.spec.ts'
797+ coreEnv : compileTypescript [
832798 devBuildPath + ' /**/*.core-env.ts'
799+ devBuildPath + ' /**/*.core-env.spec.ts'
800+ ' !' + devBuildPath + ' /lib/build-tools/**/*.ts'
801+ ' !' + devBuildPath + ' /integration/**/*.ts'
833802 ]
834803
835- chrome_extension : compileTypescript [
836- devBuildPath + ' /chrome/extension/**/*.ts'
837- ]
838-
839- chrome_app : compileTypescript [
840- devBuildPath + ' /chrome/app/**/*.ts'
841- ]
842-
843- firefox : compileTypescript [
844- devBuildPath + ' /firefox/**/*.ts'
845- ]
846-
847- cca : compileTypescript [
848- devBuildPath + ' /cca/**/*.ts'
849- ]
850-
851- integration_specs : compileTypescript [
852- devBuildPath + ' /integration/*.ts'
853- ' !' + devBuildPath + ' /integration/test_connection.ts'
854- ]
855- integration_freedom_module : compileTypescript [
856- devBuildPath + ' /integration/test_connection.ts'
857- ]
858-
859-
860804 browserify :
861805 chromeAppMain : Rule .browserify ' chrome/app/scripts/main.core-env'
862806 chromeExtMain : Rule .browserify (' chrome/extension/scripts/background' ,
@@ -896,30 +840,8 @@ gruntConfig = {
896840 # uproxy-lib
897841 loggingProvider : Rule .browserify ' lib/loggingprovider/freedom-module'
898842 churnPipeFreedomModule : Rule .browserify ' lib/churn-pipe/freedom-module'
899- cloudInstallerFreedomModule : Rule .browserify (' lib/cloud/install/freedom-module' , {
900- alias : [
901- # Shims for node's dns and net modules from freedom-social-xmpp,
902- # with a couple of fixes.
903- ' ./src/lib/cloud/social/shim/net.js:net'
904- ' ./src/lib/cloud/social/shim/dns.js:dns'
905- # Alternative that works for freedomjs modules.
906- ' ./src/lib/cloud/social/alias/brorand.js:brorand'
907- # Fallback for crypto-browserify's randombytes, for Firefox.
908- ' ./src/lib/cloud/social/alias/randombytes.js:randombytes'
909- ]
910- })
911- cloudSocialProviderFreedomModule : Rule .browserify (' lib/cloud/social/freedom-module' , {
912- alias : [
913- # Shims for node's dns and net modules from freedom-social-xmpp,
914- # with a couple of fixes.
915- ' ./src/lib/cloud/social/shim/net.js:net'
916- ' ./src/lib/cloud/social/shim/dns.js:dns'
917- # Alternative that works for freedomjs modules.
918- ' ./src/lib/cloud/social/alias/brorand.js:brorand'
919- # Fallback for crypto-browserify's randombytes, for Firefox.
920- ' ./src/lib/cloud/social/alias/randombytes.js:randombytes'
921- ]
922- })
843+ cloudInstallerFreedomModule : Rule .browserify ' lib/cloud/install/freedom-module'
844+ cloudSocialProviderFreedomModule : Rule .browserify ' lib/cloud/social/freedom-module'
923845 digitalOceanFreedomModule : Rule .browserify ' lib/cloud/digitalocean/freedom-module'
924846
925847 # uproxy-lib sample apps.
@@ -951,6 +873,14 @@ gruntConfig = {
951873 ' src/**/*.ts'
952874 ]
953875
876+ jshint :
877+ firefox :
878+ options :
879+ moz : true
880+ src : [
881+ ' src/firefox/lib/*.js'
882+ ]
883+
954884 # -------------------------------------------------------------------------
955885 jasmine :
956886 chrome_extension : Rule .jasmineSpec (' chrome/extension/scripts/' ,
@@ -1082,8 +1012,7 @@ taskManager = new TaskManager.Manager()
10821012
10831013taskManager .add ' base' , [
10841014 ' copy:dev'
1085- ' ts:devInModuleEnv'
1086- ' ts:generic_ui'
1015+ ' ts'
10871016 ' version_file'
10881017 ' browserify:chromeAppMain'
10891018 ' browserify:genericCoreFreedomModule'
@@ -1178,13 +1107,11 @@ taskManager.add 'version_file', [
11781107
11791108taskManager .add ' build_chrome_app' , [
11801109 ' base'
1181- ' ts:chrome_app'
11821110 ' copy:chrome_app'
11831111].concat fullyVulcanize (' chrome/app/polymer' , ' ext-missing' , ' vulcanized' )
11841112
11851113taskManager .add (' build_chrome_ext' , [
11861114 ' base'
1187- ' ts:chrome_extension'
11881115 ' copy:chrome_extension'
11891116 ' copy:chrome_extension_additional'
11901117 ' browserify:chromeExtMain'
@@ -1200,7 +1127,6 @@ taskManager.add 'build_chrome', [
12001127# Firefox build tasks.
12011128taskManager .add (' build_firefox' , [
12021129 ' base'
1203- ' ts:firefox'
12041130 ' copy:firefox'
12051131 ' copy:firefox_additional'
12061132 ' browserify:firefoxContext'
@@ -1210,7 +1136,6 @@ taskManager.add('build_firefox', [
12101136# CCA build tasks.
12111137taskManager .add ' build_cca' , [
12121138 ' base'
1213- ' ts:cca'
12141139 ' copy:cca'
12151140 ' copy:cca_additional'
12161141 ' browserify:ccaMain'
@@ -1305,44 +1230,45 @@ taskManager.add 'socksEchoIntegrationTest', [
13051230 ' jasmine_chromeapp:socksEcho'
13061231]
13071232
1233+ taskManager .add ' unit_test' , [
1234+ ' test_lib'
1235+ ' test_core'
1236+ ' test_ui'
1237+ ' test_chrome'
1238+ ]
1239+
13081240# TODO: add test_chrome once it passes reliably
13091241taskManager .add ' integration_test' , [
13101242 ' tcpIntegrationTest'
13111243 ' socksEchoIntegrationTest'
13121244]
13131245
1314- taskManager .add ' everything' , [
1315- ' build'
1316- ' test'
1317- ' integration_test'
1318- ]
1319-
1320- # This is the target run by Travis. Targets in here should run locally
1321- # and on Travis/Sauce Labs.
13221246taskManager .add ' test' , [
1323- ' test_lib'
1324- ' test_core'
1325- ' test_ui'
1326- ' test_chrome'
1247+ ' unit_test'
1248+ ' integration_test'
13271249]
13281250
1251+ # Builds all code, including the "dist" build, but skips
1252+ # linting and testing which can both be annoying and slow.
1253+ # jshint is here because catches hard syntax errors, etc.
13291254taskManager .add ' build' , [
13301255 ' exec:rmIosBuild'
13311256 ' exec:rmAndroidBuild'
13321257 ' build_chrome'
13331258 ' build_firefox'
13341259 ' build_cca'
1260+ ' samples'
1261+ ' jshint'
1262+ ' copy:dist'
1263+ ' jpm:xpi'
13351264]
13361265
1337- taskManager .add ' lint' , [
1338- ' tslint'
1339- ]
1340-
1266+ # This is run prior to releasing uProxy and, in addition to
1267+ # building, tests and lints all code.
13411268taskManager .add ' dist' , [
13421269 ' build'
1343- ' lint'
1344- ' copy:dist'
1345- ' jpm:xpi'
1270+ ' tslint'
1271+ ' test'
13461272]
13471273
13481274taskManager .add ' default' , [
@@ -1356,6 +1282,7 @@ module.exports = (grunt) ->
13561282 grunt .loadNpmTasks ' grunt-contrib-clean'
13571283 grunt .loadNpmTasks ' grunt-contrib-copy'
13581284 grunt .loadNpmTasks ' grunt-contrib-jasmine'
1285+ grunt .loadNpmTasks ' grunt-contrib-jshint'
13591286 grunt .loadNpmTasks ' grunt-contrib-symlink'
13601287 grunt .loadNpmTasks ' grunt-exec'
13611288 grunt .loadNpmTasks ' grunt-gitinfo'
0 commit comments