diff --git a/Sources/VariantsCore/Custom Types/Project/AndroidProject.swift b/Sources/VariantsCore/Custom Types/Project/AndroidProject.swift index 5117e3d1..ec4ed7be 100644 --- a/Sources/VariantsCore/Custom Types/Project/AndroidProject.swift +++ b/Sources/VariantsCore/Custom Types/Project/AndroidProject.swift @@ -103,7 +103,7 @@ class AndroidProject: Project { do { let projectSourceFolder = configuration.path let path = try TemplateDirectory().path - try Bash("cp", arguments: "-R", "\(path.absolute())/android/_fastlane/", projectSourceFolder) + try Bash("cp", arguments: "-R", "\(path.absolute())/android/_fastlane/", ".") .run() let baseSetupCompletedMessage = @@ -129,7 +129,7 @@ class AndroidProject: Project { """ - if Path("\(projectSourceFolder)/fastlane/").isDirectory { + if StaticPath.Fastlane.baseFolder.isDirectory { guard let defaultVariant = configuration.variants .first(where: { $0.name.lowercased() == "default" }) else { throw ValidationError("Variant 'default' not found.") @@ -145,9 +145,9 @@ class AndroidProject: Project { Your setup is complete, congratulations! 🎉 However, you still need to provide some parameters in order for fastlane to run correctly. - ⚠️ Check the files in '\(projectSourceFolder)/fastlane/parameters/', change the parameters + ⚠️ Check the files in 'fastlane/parameters/', change the parameters accordingly, provide environment variables when applicable. - ⚠️ Note that the values in the file '\(projectSourceFolder)/fastlane/parameters/variants_params.rb' + ⚠️ Note that the values in the file 'fastlane/parameters/variants_params.rb' where generated automatically for configuration properties with 'fastlane' destination. """ @@ -167,6 +167,9 @@ class AndroidProject: Project { } catch let error as ValidationError { Logger.shared.logFatal(item: error.description) + } catch let error as RuntimeError { + Logger.shared.logFatal(item: error.description) + } catch { Logger.shared.logFatal(item: error.localizedDescription) } diff --git a/Sources/VariantsCore/Custom Types/TemplateDirectory.swift b/Sources/VariantsCore/Custom Types/TemplateDirectory.swift index 17d99c20..8aa7c4e7 100644 --- a/Sources/VariantsCore/Custom Types/TemplateDirectory.swift +++ b/Sources/VariantsCore/Custom Types/TemplateDirectory.swift @@ -25,7 +25,7 @@ struct TemplateDirectory { guard let path = firstDirectory else { let dirs = directories.joined(separator: " or ") - throw RuntimeError("❌ Templates folder not found in \(dirs)") + throw RuntimeError("Templates folder not found in \(dirs)") } self.path = path diff --git a/Sources/VariantsCore/Custom Types/UtilsDirectory.swift b/Sources/VariantsCore/Custom Types/UtilsDirectory.swift index a823f27e..2f551009 100644 --- a/Sources/VariantsCore/Custom Types/UtilsDirectory.swift +++ b/Sources/VariantsCore/Custom Types/UtilsDirectory.swift @@ -25,7 +25,7 @@ struct UtilsDirectory { guard let path = firstDirectory else { let dirs = directories.joined(separator: " or ") - throw RuntimeError("❌ Utils folder not found in \(dirs)") + throw RuntimeError("Utils folder not found in \(dirs)") } self.path = path diff --git a/Sources/VariantsCore/Factory/FastlaneParametersFactory.swift b/Sources/VariantsCore/Factory/FastlaneParametersFactory.swift index 030fd49e..f242eb8f 100644 --- a/Sources/VariantsCore/Factory/FastlaneParametersFactory.swift +++ b/Sources/VariantsCore/Factory/FastlaneParametersFactory.swift @@ -83,13 +83,13 @@ class FastlaneParametersFactory: ParametersFactory { // Or does exist and 'isWritable' guard !parametersFile.exists || parametersFile.isWritable else { - throw TemplateDoesNotExist(templateNames: [parentFolder.string]) + throw RuntimeError("'\(parametersFile.abbreviate())' can't be modified, you don't have write permission.") } // Write to file try parametersFile.write(data) } else { - throw TemplateDoesNotExist(templateNames: [parentFolder.string]) + throw RuntimeError("'\(parentFolder.abbreviate())' doesn't exist or isn't a directory.") } } diff --git a/Sources/VariantsCore/Schemas/Android/AndroidConfiguration.swift b/Sources/VariantsCore/Schemas/Android/AndroidConfiguration.swift index 8378a5df..1dc6e521 100644 --- a/Sources/VariantsCore/Schemas/Android/AndroidConfiguration.swift +++ b/Sources/VariantsCore/Schemas/Android/AndroidConfiguration.swift @@ -47,7 +47,7 @@ public struct AndroidConfiguration: Codable { self.appName = try container.decode(String.self, forKey: .appName) self.appIdentifier = try container.decode(String.self, forKey: .appIdentifier) self.variants = definiteVariants - self.signing = try container.decode(AndroidSigning.self, forKey: .signing) + self.signing = try? container.decode(AndroidSigning.self, forKey: .signing) self.custom = try? container.decode([CustomProperty].self, forKey: .custom) } diff --git a/codecov.yml b/codecov.yml index 37ca0dfc..72f04bdb 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,9 +1,12 @@ coverage: status: project: + threshold: 5% core: paths: - Sources/VariantsCore tests: paths: - Tests/VariantsCoreTests + + patch: no