fastlane-plugin-android_change_package_name 0.1.6 → 0.1.8

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
  SHA256:
3
- metadata.gz: 43ce59dce49c76f68165fc371eae349b4836d09058e096914183568469cfc031
4
- data.tar.gz: 5693e0cff94eb6f2faf2e7d56b89205b09729fce81c04c4e2db8e8b1c331e09e
3
+ metadata.gz: 393a80bf58442e474ae3fe2e30572a3488c7b52bc1a7a7ab4bf5538214b0ee09
4
+ data.tar.gz: 27839d5bc6dd6117033f36101bbb0e83d00b3765fc3adea3dbd0a1848912e65f
5
5
  SHA512:
6
- metadata.gz: c1c44e937304d85e1c4c8ff3707018a1c69422aa5343ce7b2f06294805744652ba79759056b2adb3b816679a36e946a1411622db55b25b3162361fb4e6c1851a
7
- data.tar.gz: 7e5c65060833792443cc722d9b642d0637ec5a20b3cafdcab6f7f08318dc145cec6e34e223d7f08b62987d27222e74ac96871083615aa58c8e7e53634399606f
6
+ metadata.gz: 8c249558c6be5e5dbc729e533eb642e67f653b8db2e8e1928d36dfe925a4adda104978cff207a5b2c05ceb012815c5ac26489866cb5d577ede789a9a6292bac3
7
+ data.tar.gz: 2da7caa00ade2ef41b550174dce2839ad21f1aaeebb7de4039823a237c0e3d2727507b1030a8594b2db0289c4b655ef30d597c9baca5f6ff42b78d70d7123094
@@ -23,23 +23,33 @@ module Fastlane
23
23
  UI.message("Updating package name to: #{packageName}")
24
24
  end
25
25
 
26
- if originalPackageName != packageName
26
+ if originalPackageName != packageName
27
27
  File.write(manifest, @doc.to_xml)
28
28
 
29
29
  folder = originalPackageName.gsub('.', '/')
30
30
  new_folder = packageName.gsub('.', '/')
31
- new_folder_path = "#{path}/app/src/main/java/#{new_folder}"
32
-
31
+
32
+ if File.exist?("#{path}/app/src/main/java/#{folder}")
33
+ sourcesPath = "/app/src"
34
+ gradlePath = "/app"
35
+ new_folder_path = "#{path}#{sourcesPath}/main/java/#{new_folder}"
36
+ java_sources = Dir.glob("#{path}#{sourcesPath}/main/java/#{folder}/*.java")
37
+ elsif File.exist?("#{path}/src/#{folder}")
38
+ sourcesPath = "/src"
39
+ gradlePath "/."
40
+ new_folder_path = "#{path}#{sourcesPath}/#{new_folder}"
41
+ java_sources = Dir.glob("#{path}#{sourcesPath}/#{folder}/*.java")
42
+ end
43
+
33
44
  FileUtils::mkdir_p new_folder_path
34
-
35
- java_sources = Dir.glob("#{path}/app/src/main/java/#{folder}/*.java")
45
+
36
46
  java_sources.each do |file|
37
47
  FileUtils.mv file, new_folder_path
38
48
  end
39
49
 
40
50
  Bundler.with_clean_env do
41
- sh "find #{path}/app/src -name '*.java' -type f -exec sed -i '' 's/#{originalPackageName}/#{packageName}/' {} \\;"
42
- sh "find #{path}/app -name 'build.gradle' -type f -exec sed -i '' 's/#{originalPackageName}/#{packageName}/' {} \\;"
51
+ sh "find #{path}#{sourcesPath} -name '*.java' -type f -exec sed -i '' 's/#{originalPackageName}/#{packageName}/' {} \\;"
52
+ sh "find #{path}#{gradlePath} -name 'build.gradle' -type f -exec sed -i '' 's/#{originalPackageName}/#{packageName}/' {} \\;"
43
53
  end
44
54
  end
45
55
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AndroidChangePackageName
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-android_change_package_name
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - yeppao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-24 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri