lfd 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Gemfile +2 -0
  4. data/Gemfile.lock +22 -0
  5. data/README.md +43 -0
  6. data/README.zhCN.md +43 -0
  7. data/Rakefile +23 -0
  8. data/lfd.gemspec +27 -0
  9. data/lib/lfd/app.rb +53 -0
  10. data/lib/lfd/build.rb +188 -0
  11. data/lib/lfd/env.rb +92 -0
  12. data/lib/lfd/init.rb +18 -0
  13. data/lib/lfd/run.rb +46 -0
  14. data/lib/lfd/setup.rb +20 -0
  15. data/lib/lfd_version.rb +1 -1
  16. data/test/fixture/projects/flash10_flex_proj/.actionScriptProperties +23 -0
  17. data/test/fixture/projects/flash10_proj/asproj.info +17 -0
  18. data/test/fixture/projects/flash10_proj/bin/test_as_proj.swf +0 -0
  19. data/test/fixture/projects/flash10_proj/flash10_proj.as3proj +84 -0
  20. data/test/fixture/projects/flash10_proj/src/Main.as +13 -0
  21. data/test/fixture/projects/flash10_proj/tmp_proj/asproj.info +17 -0
  22. data/test/fixture/projects/flash10_proj/tmp_proj/tmp_proj/asproj.info +6 -0
  23. data/test/fixture/projects/flash10_swc_proj/asproj.info +16 -0
  24. data/test/fixture/projects/flash10_swc_proj/bin/test_as_proj.swc/catalog.xml +32 -0
  25. data/test/fixture/projects/flash10_swc_proj/bin/test_as_proj.swc/library.swf +0 -0
  26. data/test/fixture/projects/flash10_swc_proj/bin/test_as_proj.swf +0 -0
  27. data/test/fixture/projects/flash10_swc_proj/flash10_proj.as3proj +84 -0
  28. data/test/fixture/projects/flash10_swc_proj/src/Main.as +13 -0
  29. data/test/fixture/projects/flash10_swc_proj/tmp_proj/asproj.info +17 -0
  30. data/test/fixture/projects/flash10_swc_proj/tmp_proj/tmp_proj/asproj.info +6 -0
  31. data/test/fixture/projects/flash9_flex_proj/.actionScriptProperties +23 -0
  32. data/test/fixture/projects/flash9_proj/flash9_proj.as3proj +84 -0
  33. data/test/fixture/projects/should_fail_proj/should_fail_proj.as3proj +85 -0
  34. data/test/helper.rb +41 -0
  35. data/test/tc_building_proj_test.rb +28 -0
  36. data/test/tc_check_mm_cfg_test.rb +37 -0
  37. data/test/tc_env_test.rb +23 -0
  38. data/test/tc_initing_proj_test.rb +27 -0
  39. data/test/tc_running_proj_test.rb +23 -0
  40. metadata +38 -1
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <actionScriptProperties analytics="false" mainApplicationPath="ChartTest.mxml" projectUUID="c84599c4-9937-49d8-85d3-9a7862cb33fc" version="6">
3
+ <compiler additionalCompilerArguments="-locale zh_CN" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="9.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
4
+ <compilerSourcePath>
5
+ <compilerSourcePathEntry kind="1" linkType="1" path="D:/SvnProject/as_proj_nightly_builder/libraries/ccbu-trunk"/>
6
+ <compilerSourcePathEntry kind="1" linkType="1" path="D:/SvnProject/as_proj_nightly_builder/libraries/vendor"/>
7
+ </compilerSourcePath>
8
+ <libraryPath defaultLinkType="0">
9
+ <libraryPathEntry kind="4" path="">
10
+ <excludedEntries>
11
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
12
+ </excludedEntries>
13
+ </libraryPathEntry>
14
+ <libraryPathEntry kind="1" linkType="1" path="libs"/>
15
+ </libraryPath>
16
+ <sourceAttachmentPath/>
17
+ </compiler>
18
+ <applications>
19
+ <application path="/ChartEditor/[source path] ccbu-trunk/cn/alibaba/CoverPage.mxml"/>
20
+ </applications>
21
+ <modules/>
22
+ <buildCSSFiles/>
23
+ </actionScriptProperties>
@@ -0,0 +1,84 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <project>
3
+ <!-- Output SWF options -->
4
+ <output>
5
+ <movie disabled="False" />
6
+ <movie input="" />
7
+ <movie path="bin\picgen.swf" />
8
+ <movie fps="30" />
9
+ <movie width="800" />
10
+ <movie height="600" />
11
+ <movie version="9" />
12
+ <movie background="#FFFFFF" />
13
+ </output>
14
+ <!-- Other classes to be compiled into your SWF -->
15
+ <classpaths>
16
+ <class path="src" />
17
+ <class path="..\..\..\..\libary\Alibaba_CCBU_as_lib\cnued\trunk" />
18
+ </classpaths>
19
+ <!-- Build options -->
20
+ <build>
21
+ <option accessible="False" />
22
+ <option allowSourcePathOverlap="False" />
23
+ <option benchmark="False" />
24
+ <option es="False" />
25
+ <option locale="" />
26
+ <option loadConfig="" />
27
+ <option optimize="True" />
28
+ <option showActionScriptWarnings="True" />
29
+ <option showBindingWarnings="True" />
30
+ <option showDeprecationWarnings="True" />
31
+ <option showUnusedTypeSelectorWarnings="True" />
32
+ <option strict="True" />
33
+ <option useNetwork="True" />
34
+ <option useResourceBundleMetadata="True" />
35
+ <option warnings="True" />
36
+ <option verboseStackTraces="False" />
37
+ <option linkReport="" />
38
+ <option loadExterns="" />
39
+ <option staticLinkRSL="True" />
40
+ <option additional="" />
41
+ <option compilerConstants="" />
42
+ <option customSDK="" />
43
+ </build>
44
+ <!-- SWC Include Libraries -->
45
+ <includeLibraries>
46
+ <!-- example: <element path="..." /> -->
47
+ </includeLibraries>
48
+ <!-- SWC Libraries -->
49
+ <libraryPaths>
50
+ </libraryPaths>
51
+ <!-- External Libraries -->
52
+ <externalLibraryPaths>
53
+ <!-- example: <element path="..." /> -->
54
+ </externalLibraryPaths>
55
+ <!-- Runtime Shared Libraries -->
56
+ <rslPaths>
57
+ <!-- example: <element path="..." /> -->
58
+ </rslPaths>
59
+ <!-- Intrinsic Libraries -->
60
+ <intrinsics>
61
+ <!-- example: <element path="..." /> -->
62
+ </intrinsics>
63
+ <!-- Assets to embed into the output SWF -->
64
+ <library>
65
+ <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
66
+ </library>
67
+ <!-- Class files to compile (other referenced classes will automatically be included) -->
68
+ <compileTargets>
69
+ <compile path="..\..\..\..\libary\Alibaba_CCBU_as_lib\cnued\trunk\cn\alibaba\Main.as" />
70
+ </compileTargets>
71
+ <!-- Paths to exclude from the Project Explorer tree -->
72
+ <hiddenPaths>
73
+ <!-- example: <hidden path="..." /> -->
74
+ </hiddenPaths>
75
+ <!-- Executed before build -->
76
+ <preBuildCommand />
77
+ <!-- Executed after build -->
78
+ <postBuildCommand alwaysRun="False" />
79
+ <!-- Other project options -->
80
+ <options>
81
+ <option showHiddenPaths="False" />
82
+ <option testMovie="ExternalPlayer" />
83
+ </options>
84
+ </project>
@@ -0,0 +1,85 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <project>
3
+ <!-- Output SWF options -->
4
+ <output>
5
+ <movie disabled="False" />
6
+ <movie input="" />
7
+ <movie path="bin\picgen.swf" />
8
+ <movie fps="30" />
9
+ <movie width="800" />
10
+ <movie height="600" />
11
+ <movie version="10" />
12
+ <movie background="#FFFFFF" />
13
+ </output>
14
+ <!-- Other classes to be compiled into your SWF -->
15
+ <classpaths>
16
+ <class path="src" />
17
+ <class path="..\..\..\..\libary\Alibaba_CCBU_as_lib\cnued\trunk" />
18
+ </classpaths>
19
+ <!-- Build options -->
20
+ <build>
21
+ <option accessible="False" />
22
+ <option allowSourcePathOverlap="False" />
23
+ <option benchmark="False" />
24
+ <option es="False" />
25
+ <option locale="" />
26
+ <option loadConfig="" />
27
+ <option optimize="True" />
28
+ <option showActionScriptWarnings="True" />
29
+ <option showBindingWarnings="True" />
30
+ <option showDeprecationWarnings="True" />
31
+ <option showUnusedTypeSelectorWarnings="True" />
32
+ <option strict="True" />
33
+ <option useNetwork="True" />
34
+ <option useResourceBundleMetadata="True" />
35
+ <option warnings="True" />
36
+ <option verboseStackTraces="False" />
37
+ <option linkReport="" />
38
+ <option loadExterns="" />
39
+ <option staticLinkRSL="True" />
40
+ <option additional="" />
41
+ <option compilerConstants="" />
42
+ <option customSDK="" />
43
+ </build>
44
+ <!-- SWC Include Libraries -->
45
+ <includeLibraries>
46
+ <!-- example: <element path="..." /> -->
47
+ </includeLibraries>
48
+ <!-- SWC Libraries -->
49
+ <libraryPaths>
50
+ <element path="lib\picgen-lib.swc" />
51
+ </libraryPaths>
52
+ <!-- External Libraries -->
53
+ <externalLibraryPaths>
54
+ <!-- example: <element path="..." /> -->
55
+ </externalLibraryPaths>
56
+ <!-- Runtime Shared Libraries -->
57
+ <rslPaths>
58
+ <!-- example: <element path="..." /> -->
59
+ </rslPaths>
60
+ <!-- Intrinsic Libraries -->
61
+ <intrinsics>
62
+ <!-- example: <element path="..." /> -->
63
+ </intrinsics>
64
+ <!-- Assets to embed into the output SWF -->
65
+ <library>
66
+ <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
67
+ </library>
68
+ <!-- Class files to compile (other referenced classes will automatically be included) -->
69
+ <compileTargets>
70
+ <compile path="..\..\..\..\libary\Alibaba_CCBU_as_lib\cnued\trunk\cn\alibaba\product\picgen\Main.as" />
71
+ </compileTargets>
72
+ <!-- Paths to exclude from the Project Explorer tree -->
73
+ <hiddenPaths>
74
+ <!-- example: <hidden path="..." /> -->
75
+ </hiddenPaths>
76
+ <!-- Executed before build -->
77
+ <preBuildCommand />
78
+ <!-- Executed after build -->
79
+ <postBuildCommand alwaysRun="False" />
80
+ <!-- Other project options -->
81
+ <options>
82
+ <option showHiddenPaths="False" />
83
+ <option testMovie="ExternalPlayer" />
84
+ </options>
85
+ </project>
@@ -0,0 +1,41 @@
1
+ require 'test/unit'
2
+ require 'fileutils'
3
+ require 'yaml'
4
+ require_relative '../lib/lfd'
5
+
6
+ module LFDTest
7
+
8
+ class TestCase < Test::Unit::TestCase
9
+
10
+ include FileUtils
11
+
12
+ attr_reader :lfd
13
+
14
+ def setup
15
+ cd test_home_dir
16
+ FileUtils.mkdir_p proj_dir
17
+ cd proj_dir
18
+
19
+ @lfd = LFD::App.new
20
+ end
21
+
22
+ def teardown
23
+ cd test_home_dir
24
+ FileUtils.rm_rf proj_dir
25
+ end
26
+
27
+ def proj_dir
28
+ File.join test_home_dir, 'tmp_proj'
29
+ end
30
+
31
+ def test_home_dir
32
+ File.expand_path File.dirname(__FILE__)
33
+ end
34
+
35
+ def fixture_path
36
+ File.join test_home_dir, 'fixture'
37
+ end
38
+
39
+ end
40
+
41
+ end
@@ -0,0 +1,28 @@
1
+ require_relative 'helper'
2
+
3
+ module LFDTest
4
+
5
+ module Task
6
+
7
+ class BuildingProjTest < ::LFDTest::TestCase
8
+
9
+ def test_building_flash10_proj
10
+ cd "#{fixture_path}/projects/flash10_proj"
11
+ option = YAML.load_file('asproj.info')
12
+ @lfd.build
13
+ assert_equal 0, $?.exitstatus, 'building should succeed'
14
+ assert File.exist?( "#{option["output"]["file"]}" ), "binary file should have been made"
15
+ end
16
+
17
+ def test_building_swc
18
+ cd "#{fixture_path}/projects/flash10_swc_proj"
19
+ option = YAML.load_file('asproj.info')
20
+ @lfd.build
21
+ assert_equal 0, $?.exitstatus, 'building should succeed'
22
+ assert File.exist?( "#{option["output"]["file"]}" ), "binary file should have been made"
23
+ end
24
+
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,37 @@
1
+ require_relative 'helper'
2
+
3
+ module LFDTest
4
+
5
+ module Task
6
+
7
+ class CheckMMCFGTest < ::LFDTest::TestCase
8
+
9
+ MM_CFG = "#{ENV["HOME"]}/mm.cfg"
10
+
11
+ def test_create_new_cfg_file_when_none
12
+ FileUtils.rm_f MM_CFG
13
+ @lfd.check_tracelog_config
14
+
15
+ assert File.exist?(MM_CFG)
16
+ assert_right_config
17
+ end
18
+
19
+ def test_ajust_when_exist
20
+ File.open(MM_CFG, 'w') do |file|
21
+ file.puts "ErrorReportingEnable=0\nTraceOutputFileEnable=0\ntest=1"
22
+ end
23
+ @lfd.check_tracelog_config
24
+ assert_equal "ErrorReportingEnable=1\nTraceOutputFileEnable=1\ntest=1\n", File.read(MM_CFG)
25
+ end
26
+
27
+ private
28
+ def assert_right_config
29
+ assert File.readlines(MM_CFG).any? { |line| line.chomp == "ErrorReportingEnable=1" }
30
+ assert File.readlines(MM_CFG).any? { |line| line.chomp == "TraceOutputFileEnable=1" }
31
+ end
32
+
33
+
34
+ end
35
+
36
+ end
37
+ end
@@ -0,0 +1,23 @@
1
+ require_relative 'helper'
2
+ require 'yaml'
3
+
4
+ module LFDTest
5
+
6
+ module Task
7
+
8
+ class EnvTest < ::LFDTest::TestCase
9
+
10
+ def test_check_flex_sdk_env
11
+ assert lfd.flex_sdk_ready?
12
+ assert lfd.mxmlc_ready?
13
+ assert lfd.compc_ready?
14
+ end
15
+
16
+ def test_check_fp_env
17
+ assert lfd.fp_ready?
18
+ end
19
+
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,27 @@
1
+ require_relative 'helper'
2
+
3
+ module LFDTest
4
+
5
+ module Task
6
+
7
+ class BuildingProjTest < ::LFDTest::TestCase
8
+
9
+ def test_create_new_project_without_options
10
+ @lfd.init
11
+ assert_proj_struct
12
+ end
13
+
14
+ private
15
+
16
+ def assert_proj_struct
17
+ assert File.exist?('asproj.info');
18
+ assert File.directory?('src');
19
+ assert File.directory?('lib');
20
+ assert File.directory?('bin');
21
+ assert File.directory?('tmp');
22
+ end
23
+
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,23 @@
1
+ require_relative 'helper'
2
+
3
+ module LFDTest
4
+
5
+ module Task
6
+
7
+ class RunningProjTest < ::LFDTest::TestCase
8
+
9
+ def test_building_flash10_proj
10
+ cd "#{fixture_path}/projects/flash10_proj"
11
+ option = YAML.load_file('asproj.info')
12
+
13
+ @lfd.build
14
+ assert_equal 0, $?.exitstatus
15
+
16
+ @lfd.run
17
+ assert_equal 0, $?.exitstatus
18
+ end
19
+
20
+ end
21
+
22
+ end
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lfd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - qhwa
@@ -76,12 +76,49 @@ extra_rdoc_files:
76
76
  - README.rdoc
77
77
  - lfd.rdoc
78
78
  files:
79
+ - ".gitignore"
80
+ - Gemfile
81
+ - Gemfile.lock
82
+ - README.md
79
83
  - README.rdoc
84
+ - README.zhCN.md
85
+ - Rakefile
80
86
  - bin/lfd
87
+ - lfd.gemspec
81
88
  - lfd.rdoc
82
89
  - lib/asproj.info.sample
83
90
  - lib/lfd.rb
91
+ - lib/lfd/app.rb
92
+ - lib/lfd/build.rb
93
+ - lib/lfd/env.rb
94
+ - lib/lfd/init.rb
95
+ - lib/lfd/run.rb
96
+ - lib/lfd/setup.rb
84
97
  - lib/lfd_version.rb
98
+ - test/fixture/projects/flash10_flex_proj/.actionScriptProperties
99
+ - test/fixture/projects/flash10_proj/asproj.info
100
+ - test/fixture/projects/flash10_proj/bin/test_as_proj.swf
101
+ - test/fixture/projects/flash10_proj/flash10_proj.as3proj
102
+ - test/fixture/projects/flash10_proj/src/Main.as
103
+ - test/fixture/projects/flash10_proj/tmp_proj/asproj.info
104
+ - test/fixture/projects/flash10_proj/tmp_proj/tmp_proj/asproj.info
105
+ - test/fixture/projects/flash10_swc_proj/asproj.info
106
+ - test/fixture/projects/flash10_swc_proj/bin/test_as_proj.swc/catalog.xml
107
+ - test/fixture/projects/flash10_swc_proj/bin/test_as_proj.swc/library.swf
108
+ - test/fixture/projects/flash10_swc_proj/bin/test_as_proj.swf
109
+ - test/fixture/projects/flash10_swc_proj/flash10_proj.as3proj
110
+ - test/fixture/projects/flash10_swc_proj/src/Main.as
111
+ - test/fixture/projects/flash10_swc_proj/tmp_proj/asproj.info
112
+ - test/fixture/projects/flash10_swc_proj/tmp_proj/tmp_proj/asproj.info
113
+ - test/fixture/projects/flash9_flex_proj/.actionScriptProperties
114
+ - test/fixture/projects/flash9_proj/flash9_proj.as3proj
115
+ - test/fixture/projects/should_fail_proj/should_fail_proj.as3proj
116
+ - test/helper.rb
117
+ - test/tc_building_proj_test.rb
118
+ - test/tc_check_mm_cfg_test.rb
119
+ - test/tc_env_test.rb
120
+ - test/tc_initing_proj_test.rb
121
+ - test/tc_running_proj_test.rb
85
122
  homepage: https://github.com/qhwa/LFD
86
123
  licenses: []
87
124
  metadata: {}