Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Fastfile « fastlane - github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7414e21cf1bcbe4b57cb233c0b68358d29a77c6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

opt_out_usage

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:android)

platform :android do
  desc "Runs Unit tests"
  private_lane :unittests do
    gradle(task: "testPlayReleaseUnitTest")
  end

  desc "Runs Instrumented tests"
  private_lane :instrumentedtests do
    gradle(task: "connectedDevDebugAndroidTest")
  end

  lane :release_beta do
    unittests
    instrumentedtests
    info = computeversion
    tag(info)
    gradle(
      task: 'assemble',
      build_type: 'Release',
      flavor: 'play'
    )
  end

  desc "compute version"
  private_lane :computeversion do |options|
      File.open("../app/build.gradle","r") do |f|
          text = f.read

          versionCode = text.match(/versionCode ([0-9]*)$/)
          versionCodeInt = versionCode[1].to_i
          versionName = text.match(/versionName "([0-9,\.]*)"$/)
          versionNameString = versionName[1].to_s

          print "VersionCode: " + versionCodeInt.to_s + "\n"
          print "Name: " + versionNameString + "\n"

          answer = prompt(text: "is this okay?", boolean: true)

          if !answer
              exit
          end

          { "versionCode" => versionCode.to_s, "versionName" => versionNameString }
      end
  end

  desc "Adding git tag"
  private_lane :tag do |options|
      add_git_tag(
          tag: options["versionName"],
          sign: true
      )
      push_git_tags(
          tag: options["versionName"])
  end

  private_lane :SignedRelease do |options|
      gradle(
          task: 'assemble',
          flavor: 'play',
          build_type: 'Release',
          print_command: false,
          properties: {
                "android.injected.signing.store.file" => ENV["FASTLANE_NEXTCLOUD_STORE_FILE"],
                "android.injected.signing.store.password" => ENV["FASTLANE_NEXTCLOUD_STORE_PASSWORD"],
                "android.injected.signing.key.alias" => ENV["FASTLANE_NEXTCLOUD_DECK_KEY_ALIAS"],
                "android.injected.signing.key.password" => ENV["FASTLANE_NEXTCLOUD_DECK_KEY_PASSWORD"],
              }
          )
  end
end