lib/dryrun/android_project.rb in dryrun-0.4.0 vs lib/dryrun/android_project.rb in dryrun-0.4.1

- old
+ new

@@ -27,12 +27,10 @@ file = "#{@path_to_sample}/build.gradle" # Write good lines to temporary file open(file, 'r').each { |l| tmp << l unless l.include? 'applicationId' } - - # Close tmp, or troubles ahead tmp.close # Move temp file to origin FileUtils.mv(tmp.path, file) @@ -74,13 +72,12 @@ system('chmod +x gradlew') builder = 'sh gradlew' end - # Generate the gradle/ folder - if File.exist?('gradlew') and !File.directory?('gradle/') + if File.exist?('gradlew') and !is_gradle_wrapped system('gradle wrap') end self.uninstall self.remove_application_id @@ -90,9 +87,18 @@ puts "Installing #{@package.green}...\n" puts "executing: #{execute_line.green}\n\n" system(execute_line) + end + + def is_gradle_wrapped + + if !File.directory?('gradle/') + return false + end + #binding.pry + File.exist?('gradle/wrapper/gradle-wrapper.properties') and File.exist?('gradle/wrapper/gradle-wrapper.jar') end def sample_project @modules.each do |child|