lib/dryrun/android_project.rb in dryrun-1.1.6 vs lib/dryrun/android_project.rb in dryrun-1.2.0
- old
+ new
@@ -12,11 +12,10 @@
@custom_app_path = custom_app_path
@custom_module = custom_module
@base_path = @custom_app_path ? File.join(path, @custom_app_path) : path
@flavour = flavour
@device = device
-
@settings_gradle_path = settings_gradle_file
@main_gradle_file = main_gradle_file
check_custom_app_path
@@ -79,11 +78,14 @@
def find_modules
return [] unless valid?
content = File.open(@settings_gradle_path, 'rb').read
+
+ content = content.split(/\n/).delete_if { |x| x.start_with?("rootProject")}.join("\n")
modules = content.scan(/'([^']*)'/)
+
modules.each {|replacement| replacement.first.tr!(':', '')}
end
def execute_command(command)
Dir.chdir @base_path
@@ -110,10 +112,10 @@
end
def sample_project
if @custom_module && @modules.any? {|m| m.first == "#{@custom_module}"}
@path_to_sample = File.join(@base_path, "#{@custom_module}")
- return @path_to_sample
+ return @path_to_sample if parse_manifest(@path_to_sample)
else
@modules.each do |child|
full_path = File.join(@base_path, child.first)
@path_to_sample = full_path
return full_path if parse_manifest(full_path)