Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Sources/VariantsCore/Custom Types/Project/AndroidProject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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.")
Expand All @@ -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.

"""
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/VariantsCore/Custom Types/TemplateDirectory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/VariantsCore/Custom Types/UtilsDirectory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Sources/VariantsCore/Factory/FastlaneParametersFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
coverage:
status:
project:
threshold: 5%
core:
paths:
- Sources/VariantsCore
tests:
paths:
- Tests/VariantsCoreTests

patch: no