Sha256: 128184b1614339a3b6e2e6c4ed504d9b2dab2f056d597c5e7d73ff39eef6eefd

Contents?: true

Size: 659 Bytes

Versions: 3

Compression:

Stored size: 659 Bytes

Contents

# frozen_string_literal: true

module Headdesk
  module Checks
    #
    # APKs should all target API 26+
    #
    # :reek:UncommunicativeModuleName
    class Api26
      include Check::APK

      describe 'targetSdkVersion must be at least 26'
      def call
        fail_check unless: -> { apk.targets_sdk 26 }

        klass_def = 'android/support/v4/app/NotificationCompat$Builder'
        skip_check unless: -> { apk.class?(klass_def) }
        klass = apk.find_class(klass_def)

        describe 'support-v4 version is 26.1+'
        fail_check unless: -> { klass.method?('setChannelId') }

        # TODO: AndroidX/JetPack
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
headdesk-0.3.0 lib/headdesk/checks/api26.rb
headdesk-0.2.0 lib/headdesk/checks/api26.rb
headdesk-0.1.0 lib/headdesk/checks/api26.rb