SiarheiFedartsou / fastlane-plugin-versioning

Extends fastlane versioning actions. Allows to set/get versions without using agvtool and do some other small tricks.
MIT License
504 stars 60 forks source link

error when try to increment one of the different target in my project #29

Closed st-small closed 5 years ago

st-small commented 5 years ago

Thank you very much for your plugin. But I have trouble and want to fix it. I have project with multiple targets and each of them has different build number. I want to get current build number of the target and increment it. This is my example:

project = './CoreFrameworkApp/CoreFrameworkApp.xcodeproj'
target = 'Demo'
version = get_build_number_from_plist(xcodeproj: project,
                                        target: target,
                                        build_configuration_name: 'Release').to_i + 1
###################################
platform :ios do
  desc "Builds, achieves and uploads ipa to TestFlight"
  lane :testflight_lane do
    cert
    sigh
    increment_build_number_in_plist(
        build_number: version.to_s,
        target: target,
    )
    gym(
    workspace: "MyProject.xcworkspace",
        scheme: "Demo",
        configuration: "Release",
        clean: true,
        output_directory: "./build",
        output_name: "#{target}.ipa",
    )
    upload_to_testflight(
           skip_submission: true,
           skip_waiting_for_build_processing: true
    )
  end
end

I have error message: 'no implicit conversion of nil into String'. What does it mean? Thank you very much for help.

st-small commented 5 years ago

I'm very sorry. It was my bag. I misunderstood how plugin works. I thought after plugin finished it should update build value in Xcode Info tab. And worried why it didn't updates. But now if I reload my Xcode project it updates successfully. So plugin works perfect! Thank you! My last Fastlane file for example:

default_platform(:ios)
project = './CoreFrameworkApp/CoreFrameworkApp.xcodeproj'
target = 'Demo'
###################################
platform :ios do
  desc "Builds, achieves and uploads ipa to TestFlight"
  lane :testflight_lane do
    cert
    sigh
    increment_build_number_in_plist(xcodeproj: project, target: target)
    gym(
        workspace: "MyProject.xcworkspace",
        scheme: "Demo",
        configuration: "Release",
        clean: true,
        output_directory: "./build",
        output_name: "#{target}.ipa",
    )
    upload_to_testflight(
           skip_submission: true,
           skip_waiting_for_build_processing: true
        )
  end
end