fastlane-plugin-xliff_en_gen 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f52e504b6a930f6b8266dba33d5a7d1671a1c7b4
4
- data.tar.gz: '08277625ce5e608abfb6565cd69e10ab9711e4e2'
3
+ metadata.gz: 942548b1bd3629c6ffbfa8400fe834cc5c0af851
4
+ data.tar.gz: 7d6c675c2c2fe44b100a93d6e25053a227fc52bd
5
5
  SHA512:
6
- metadata.gz: f6b0d3c0f66599717b6a468ac3d5b600b1f93fed3e68cbadbf09429d319f2e2bfb4b6c15545ecb3cfb53f5dff8faa72103566796d3355fc4444aa2d4a4698683
7
- data.tar.gz: 537f39b2afa0506966536b66294c89a5b85b871c28d97cebcf9b5701c3e9cb758cbe992bbca85b4a1cf02fde54cc49bbd631fea46f1a860554ffeb640eb951c3
6
+ metadata.gz: 3fb0b17c1d60a3878cd1243142be71eb5391140caf2bd6d21d790c7709e894809f718e7573d1ba043cca1e6d487cd8b08d3c9ac68e33fce6eb34f1f1081ad9dc
7
+ data.tar.gz: 0c3d1732cd0844e239bf200ae1ac600b669646b7898874dc8accbb8b1c387142b22c9090e6b0e03415d65c2b0c0f8ca7be0a7041036581e578e4789eaa55949f
@@ -0,0 +1,77 @@
1
+ module Fastlane
2
+ module Actions
3
+ module SharedValues
4
+ XE_XLIFF_LOCATION = :XE_XLIFF_LOCATION
5
+ end
6
+ class ExportXliffAction < Action
7
+ def self.run(params)
8
+
9
+ projectPath = File.absolute_path(params[:xcodeproj])
10
+
11
+ UI.message("Located project at: "+projectPath)
12
+
13
+ workingPath = File.dirname(projectPath)
14
+
15
+ dir = File.dirname(projectPath)
16
+
17
+ file = File.basename(projectPath)
18
+
19
+ sh ("cd #{dir} && xcodebuild -exportLocalizations -localizationPath #{workingPath} -project #{file} -exportLanguage en")
20
+
21
+ xliffPath = File.join(workingPath, "en.xliff")
22
+
23
+ Actions.lane_context[SharedValues::XE_XLIFF_LOCATION] = xliffPath
24
+
25
+ xliffPath
26
+ end
27
+
28
+
29
+
30
+ def self.description
31
+ "export xliff for an xcode project"
32
+ end
33
+
34
+ def self.authors
35
+ ["alexander sun"]
36
+ end
37
+
38
+ def self.return_value
39
+ # If your method provides a return value, you can describe here what it does
40
+ end
41
+
42
+ def self.output
43
+ [
44
+ ['XE_XLIFF_LOCATION', 'Path to en.xliff']
45
+ ]
46
+ end
47
+
48
+ def self.details
49
+ "using "
50
+ end
51
+
52
+ def self.available_options
53
+ [
54
+ FastlaneCore::ConfigItem.new(key: :xcodeproj,
55
+ env_name: "XLIFF_EN_GEN_PROJECT",
56
+ description: "Specify the path to your main Xcode project",
57
+ optional: false,
58
+ type: String,
59
+ verify_block: proc do |value|
60
+ UI.user_error!("Please specify your project file path") if !value.end_with? ".xcodeproj"
61
+ UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
62
+ end),
63
+ FastlaneCore::ConfigItem.new(key: :exportLanguage,
64
+ env_name: "XLIFF_EN_GEN_LANGUAGE",
65
+ description: "target language",
66
+ optional: true,
67
+ type: String,
68
+ default_value: "en")
69
+ ]
70
+ end
71
+
72
+ def self.is_supported?(platform)
73
+ [:ios, :mac].include?(platform)
74
+ end
75
+ end
76
+ end
77
+ end
@@ -1,8 +1,5 @@
1
1
  module Fastlane
2
2
  module Actions
3
- module SharedValues
4
- XE_XLIFF_LOCATION = :XE_XLIFF_LOCATION
5
- end
6
3
  class XliffEnGenAction < Action
7
4
  def self.run(params)
8
5
 
@@ -12,18 +9,8 @@ module Fastlane
12
9
 
13
10
  UI.message("Located project at: "+projectPath)
14
11
 
15
- workingPath = File.dirname(projectPath)
16
-
17
- dir = File.dirname(projectPath)
18
-
19
- file = File.basename(projectPath)
20
-
21
- sh ("cd #{dir} && xcodebuild -exportLocalizations -localizationPath #{workingPath} -project #{file} -exportLanguage en")
12
+ xliffPath = other_action.export_xliff(xcodeproj:projectPath)
22
13
 
23
- xliffPath = File.join(workingPath, "en.xliff")
24
-
25
- Actions.lane_context[SharedValues::XE_XLIFF_LOCATION] = xliffPath
26
-
27
14
  doc = Nokogiri::XML(File.open(xliffPath))
28
15
 
29
16
  doc.remove_namespaces!
@@ -96,7 +83,7 @@ module Fastlane
96
83
  end
97
84
  def self.output
98
85
  [
99
- ['XE_XLIFF_LOCATION', 'Path to en.xliff']
86
+
100
87
  ]
101
88
  end
102
89
 
@@ -135,7 +122,6 @@ module Fastlane
135
122
 
136
123
  def self.is_supported?(platform)
137
124
  [:ios, :mac].include?(platform)
138
- true
139
125
  end
140
126
  end
141
127
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module XliffEnGen
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-xliff_en_gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - alexander sun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-26 00:00:00.000000000 Z
11
+ date: 2017-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -117,6 +117,7 @@ files:
117
117
  - LICENSE
118
118
  - README.md
119
119
  - lib/fastlane/plugin/xliff_en_gen.rb
120
+ - lib/fastlane/plugin/xliff_en_gen/actions/export_xliff.rb
120
121
  - lib/fastlane/plugin/xliff_en_gen/actions/xliff_en_gen_action.rb
121
122
  - lib/fastlane/plugin/xliff_en_gen/helper/xliff_en_gen_helper.rb
122
123
  - lib/fastlane/plugin/xliff_en_gen/version.rb