Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAB build and sign support for Android, compile constants support and other improvements #41

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

inikityuk
Copy link

Hey @voydz,

Had a bit of time recently to update your plugin. Major changes are:

  1. Android: added ability to build AAB files (including signing)
  2. Android: added support to projects with multiple AndroidManifest files (handy if your build configuration using different ones)
  3. Android: added "key-password" signing property (handy if "store password" doesn't match with "key password")
  4. Android/iOS: added support for compile constants (handy if you using them as switches in projects)
  5. iOS: added ability to specify provisioning profile to sign with
  6. Updated readme with most common properties and basic usage

NOTE:
this PR will resolve few open issues:
#34
#33

Happy to keep it updated for some time if any new issues come up.

i-nikityuk and others added 16 commits May 25, 2022 13:27
Added addition check for "keystore_password" before trying to sign apk
…manifest_files

Making sure we getting AndroidManifest file location exactly from con…
…ed_no_need_to_sign_with_default_keypass

Removed double signing of apk file
Added key-pass support
Changed naming for signed APK and AAB files (name will be affected, not an extension)
…le to sign with

Added "build_platform" property validation
…ecify_provisioning_profile_to_sign_with

Added "provision_profile_uuid" property to specify provisioning profi…
added ability to create .xcarchive on build for iOS
@inikityuk inikityuk closed this Aug 16, 2022
@inikityuk
Copy link
Author

inikityuk commented Aug 16, 2022

Feels like "souyuz" is not supporting this repo, I'm going to create separate plugin for fastlane with current modifications.
For anyone looking to build Xamarin apps for Android (APK or AAB) or iOS can fork or pull all new changes from "inikityuk"

@voydz voydz reopened this Aug 16, 2022
Copy link
Owner

@voydz voydz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @inikityuk ,

thank you very much for your time and effort. I checked your changes and got some proposals and change requests. Your opinion is appreciated.

@@ -4,6 +4,18 @@ A fastlane component to make Xamarin builds a breeze. Souyuz is now avaialbe as

*NOTE: While souyuz should continue working with your existing configuration just fine, consider using the Fastlane plugin.*

# inikityuk 16/08/2022
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please extract this portion to a CHANGELOG.md file?

configuration = Souyuz.config[:build_configuration]
platform = Souyuz.config[:build_platform]

doc_node = doc_csproj.xpath("/*[local-name()='Project']/*[local-name()='PropertyGroup'][translate(@*[local-name() = 'Condition'],'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = \" '$(configuration)|$(platform)' == '#{configuration.downcase}|#{platform.downcase}' \"]/*[local-name()='AndroidManifest']/text()")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be cleaned up a bit?
It looks like it is somewhat similar to Lines 172 in the same file.

configuration = Souyuz.config[:build_configuration]
platform = Souyuz.config[:build_platform]

compile_constants_node = doc_csproj.xpath("/*[local-name()='Project']/*[local-name()='PropertyGroup'][translate(@*[local-name() = 'Condition'],'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = \" '$(configuration)|$(platform)' == '#{configuration.downcase}|#{platform.downcase}' \"]/*[local-name()='DefineConstants']/text()")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

configuration = Souyuz.config[:build_configuration]
platform = Souyuz.config[:build_platform]

android_package_format_node = doc_csproj.xpath("/*[local-name()='Project']/*[local-name()='PropertyGroup'][translate(@*[local-name() = 'Condition'],'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = \" '$(configuration)|$(platform)' == '#{configuration.downcase}|#{platform.downcase}' \"]/*[local-name()='AndroidPackageFormat']/text()")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@@ -44,7 +45,8 @@ def build_targets
def targets
targets = []
targets += build_targets
targets << "-t:SignAndroidPackage" if Souyuz.project.android?
targets << "-t:SignAndroidPackage" if Souyuz.project.android? and !Souyuz.config[:keystore_path] and !Souyuz.config[:keystore_alias] and !Souyuz.config[:keystore_password]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you group those conditions to a helper method for better readability, please?

@@ -2,6 +2,10 @@

module Souyuz
class Options

PROVISION_FILES_DEFAULT_LOCATION = "#{Dir.home}/Library/MobileDevice/Provisioning\ Profiles/".freeze
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of this: Allow the user not to specify a provisioning profile UUID but the whole path to it. You give the user more flexibility if the profile is downloaded to the project folder for example.
Therefore we can safe us from hardcoding paths which are prone to change in future buildchain versions.


# Set provisioning profile
if config[:provision_profile_uuid]
provision_profile_default_path = "#{Dir.home}/Library/MobileDevice/Provisioning\ Profiles/".freeze
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See provisioning profile proposal above.


xml = doc.to_xml
UI.command_output(xml) if $verbose
File.write(Souyuz.config[:project_path], xml)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be noted for the user, that using this function will change the project file. That could be an issue for some CI setups. So I think its best to make the user aware of that.


xml = doc.to_xml
UI.command_output(xml) if $verbose
File.write(Souyuz.config[:project_path], xml)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be noted for the user, that using this function will change the project file. That could be an issue for some CI setups. So I think its best to make the user aware of that.

i-nikityuk and others added 2 commits June 13, 2024 14:15
Updated APK signing process to use latest build-tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants