Sha256: b2979d2bd744152f208874965228756b67b9ba1f4b4d83cdbaf1ae8b7ca67697

Contents?: true

Size: 684 Bytes

Versions: 16

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

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

      check_name 'api26'
      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

16 entries across 16 versions & 1 rubygems

Version Path
headdesk-0.14.0 lib/headdesk/checks/api26.rb
headdesk-0.13.0 lib/headdesk/checks/api26.rb
headdesk-0.12.0 lib/headdesk/checks/api26.rb
headdesk-0.11.3 lib/headdesk/checks/api26.rb
headdesk-0.11.2 lib/headdesk/checks/api26.rb
headdesk-0.11.1 lib/headdesk/checks/api26.rb
headdesk-0.11.0 lib/headdesk/checks/api26.rb
headdesk-0.10.0 lib/headdesk/checks/api26.rb
headdesk-0.9.0 lib/headdesk/checks/api26.rb
headdesk-0.8.0 lib/headdesk/checks/api26.rb
headdesk-0.7.0 lib/headdesk/checks/api26.rb
headdesk-0.6.0 lib/headdesk/checks/api26.rb
headdesk-0.5.2 lib/headdesk/checks/api26.rb
headdesk-0.5.1 lib/headdesk/checks/api26.rb
headdesk-0.5.0 lib/headdesk/checks/api26.rb
headdesk-0.4.0 lib/headdesk/checks/api26.rb