fixup! add build env for was grunt build 65/147265/5
authorYoungsoo Choi <kenshin.choi@samsung.com>
Sun, 3 Sep 2017 05:03:02 +0000 (14:03 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Thu, 7 Sep 2017 09:45:17 +0000 (18:45 +0900)
This fixes followings.

1. Default out folder is changed like electron default build configuration.
2. Depth of path is changed as build folder has been moved into wrt folder.

Change-Id: I0350b89f36faaa4b358e81805a0cad2126887eac
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
wrt/build/Gruntfile.coffee
wrt/build/tasks/build-task.coffee
wrt/build/tasks/was-runtime-test.coffee

index 5dbea96..338e75a 100644 (file)
@@ -3,7 +3,7 @@ path = require 'path'
 os = require 'os'
 glob = require 'glob'
 usesBabel = require './lib/uses-babel'
-electronBinaryPath = path.resolve(__dirname, '../','electron_binary', 'electron-v0.31.0-linux-x64');
+electronBinaryPath = path.resolve(__dirname, '../../','electron_binary', 'electron-v0.31.0-linux-x64');
 process.env.ELECTRON_PATH = electronBinaryPath;
 # # Add support for obselete APIs of vm module so we can make some third-party
 # # modules work under node v0.11.x.
@@ -34,7 +34,7 @@ module.exports = (grunt) ->
   grunt.loadNpmTasks('grunt-mocha-cli')
 
   # This allows all subsequent paths to the relative to the root of the repo
-  grunt.file.setBase(path.resolve('..'))
+  grunt.file.setBase(path.resolve('../..'))
 
   if not grunt.option('verbose')
     grunt.log.writeln = (args...) -> grunt.log
@@ -45,9 +45,9 @@ module.exports = (grunt) ->
   runtimeName = 'wrt'
   wrtDir = path.join(path.resolve(), runtimeName)
   babelCompiledDir = path.join(path.resolve(), 'babel_compiled')
-  asarPacagePath = path.join(path.resolve(), 'out','R','resources','app.asar')
+  asarPacagePath = path.join(path.resolve(), 'out','D','resources','app.asar')
   appName = if process.platform is 'darwin' then 'was.app' else 'was'
-  buildDir = path.join( path.resolve(), 'out', 'R' )
+  buildDir = path.join( path.resolve(), 'out', 'D' )
   buildDir = path.resolve(buildDir)
   installDir = grunt.option('install-dir')
 
@@ -78,7 +78,7 @@ module.exports = (grunt) ->
     glob_to_multiple:
       expand: true
       src: [
-        '**/*.coffee'
+        'wrt/**/*.coffee'
       ]
       dest: path.resolve()
       ext: '.js'
@@ -88,7 +88,7 @@ module.exports = (grunt) ->
       presets: ['es2015']
     dist:
       files: []
-  for jsFile in glob.sync('src/**/*.js')
+  for jsFile in glob.sync('wrt/src/**/*.js')
     if usesBabel(jsFile)
       console.log 'use babel : #{jsFile}'
       babelConfig.dist.files.push({
@@ -97,8 +97,8 @@ module.exports = (grunt) ->
       })
   eslintConfig =
     options:
-      configFile: 'build/.eslintrc'
-    target: ['src/**/*.js','build/test/**/*.js']
+      configFile: 'wrt/build/.eslintrc'
+    target: ['wrt/src/**/*.js','wrt/build/test/**/*.js']
 
   grunt.initConfig
     pkg: grunt.file.readJSON('package.json')
@@ -113,27 +113,27 @@ module.exports = (grunt) ->
       options:
         configFile: 'coffeelint.json'
       src: [
-        '**/*.coffee'
+        'wrt/**/*.coffee'
       ]
       build: [
-        'build/tasks/**/*.coffee'
-        'build/Gruntfile.coffee'
+        'wrt/build/tasks/**/*.coffee'
+        'wrt/build/Gruntfile.coffee'
       ]
     eslint: eslintConfig
       # test: [
-      #   'spec/*.coffee'
+      #   'wrt/spec/*.coffee'
       # ]
 
     # standard:
     #   src: [
-    #     'src/**/*.js'
-    #     'static/*.js'
+    #     'wrt/src/**/*.js'
+    #     'wrt/static/*.js'
     #   ]
 
     mochacli:
       options:
         reporter: 'spec'
-      installer: ['build/test/installer/*.js']
+      installer: ['wrt/build/test/installer/*.js']
 #      all: ['build/test/**/*.js', 'build/test/**/**/*.js', 'build/test/**/**/**/**/*.js']
 
 
@@ -149,9 +149,9 @@ module.exports = (grunt) ->
     #     appDirectory: shellAppDir
     #     outputDirectory: path.join(buildDir, 'installer')
     #     authors: 'GitHub Inc.'
-    #     loadingGif: path.resolve(__dirname, '..', 'resources', 'win', 'loading.gif')
+    #     loadingGif: path.resolve(__dirname, '../..', 'resources', 'win', 'loading.gif')
     #     iconUrl: 'https://raw.githubusercontent.com/atom/atom/master/resources/win/atom.ico'
-    #     setupIcon: path.resolve(__dirname, '..', 'resources', 'win', 'atom.ico')
+    #     setupIcon: path.resolve(__dirname, '../..', 'resources', 'win', 'atom.ico')
     #     remoteReleases: 'https://atom.io/api/updates'
 
     # shell:
index 286fb4b..5c902be 100644 (file)
@@ -13,7 +13,7 @@ module.exports = (grunt) ->
     babelCompiledDir = grunt.config.get('was.babelCompiledDir')
     babelCompiledSrcDir = path.join(babelCompiledDir, 'wrt', 'src')
     wrtSrcDir = path.join(wrtDir, 'src')
-    wrt_node_modules = 'node_modules'
+    wrt_node_modules = path.resolve('node_modules')
 
     console.log "shellAppDir #{shellAppDir}"
     console.log "buildDir #{buildDir}"
@@ -26,7 +26,7 @@ module.exports = (grunt) ->
     #it had maded when electron build
     # mkdir path.dirname(buildDir)
 
-    #we use default electron build path "out/R"
+    #we use default electron build path "out/D"
     # if process.platform is 'darwin'
     #   cp 'atom-shell/Atom.app', shellAppDir, filter: /default_app/
     # else
index 7bc796a..032715a 100644 (file)
@@ -3,14 +3,14 @@ path = require 'path'
 grunt = require 'grunt'
 spawn = grunt.util.spawn
 
-#electronBinaryPath = path.resolve(__dirname, '../../','electron_binary', 'electron-v0.31.0-linux-x64','electron');
-electronBinaryPath = path.resolve(__dirname, '../../','out', 'R','electron');
-electronMocah = path.resolve(__dirname, '../','node_modules','electron-mocha', 'bin','electron-mocha');
-mainProcesstestFile =  path.resolve(__dirname, '../','test','runtime', 'js','main-process','*.js');
-rendererProcesstestFile =  path.resolve(__dirname, '../','test','runtime', 'js','renderer-process','*.js');
-wasHome =  path.resolve(__dirname,'../../');
-installerPath = path.resolve(__dirname,'../../','installer');
-wasAppsRepo = path.resolve(__dirname,'../../','apps_repo');
+#electronBinaryPath = path.resolve(__dirname, '../../../','electron_binary', 'electron-v0.31.0-linux-x64','electron');
+electronBinaryPath = path.resolve(__dirname, '../../../../','out', 'D','electron');
+electronMocah = path.resolve(__dirname, '../../','node_modules','electron-mocha', 'bin','electron-mocha');
+mainProcesstestFile =  path.resolve(__dirname, '../../','test','runtime', 'js','main-process','*.js');
+rendererProcesstestFile =  path.resolve(__dirname, '../../','test','runtime', 'js','renderer-process','*.js');
+wasHome =  path.resolve(__dirname,'../../../');
+installerPath = path.resolve(__dirname,'../../../','installer');
+wasAppsRepo = path.resolve(__dirname,'../../../','apps_repo');
 
 process.env.DEBUG = 'WEBAPPLICATION,RUNTIME,TRY';
 process.env.ELECTRON_PATH = electronBinaryPath;
@@ -62,4 +62,4 @@ module.exports = (grunt) ->
         done code == 0
     child.stdout.pipe(process.stdout);
     child.stderr.pipe(process.stderr);
-  )
\ No newline at end of file
+  )