Skip to content

Instantly share code, notes, and snippets.

//
// AppDelegate.swift
// SqliteTestApp
//
// Created by HASAN HUSEYIN GUCUYENER on 11.05.2022.
//
import UIKit
import SQLite3
import CoreData
DELETE FROM messages
WHERE primary_key IN (
SELECT msg.primary_key FROM messages AS msg
INNER JOIN (
SELECT MAX(primary_key) AS biggest_primary_key, message_id
FROM messages
GROUP BY message_id
HAVING COUNT(message_id) > 1
) AS dup
WHERE msg.message_id = dup.message_id AND msg.primary_key < dup.biggest_primary_key
lane :beta do
increment_build_number
build_app
upload_to_testflight
end
lane :release do
capture_screenshots
build_app
upload_to_app_store # Upload the screenshots and the binary to iTunes
desc "Send application to app store"
lane :deliverToAppStore do
deliver(
submit_for_review: false,
automatic_release: false,
phased_release: true,
force: true, # Skip HTMl report verification
skip_metadata: false,
skip_screenshots: true,
skip_binary_upload: false
stage('Send to App Store') {
when {
expression {
return env.shouldBuild != "false" && env.BRANCH_NAME == "master"
}
}
steps {
sh "fastlane deliverToAppStore"
}
}
stage('Build application for prod') {
when {
expression {
return env.shouldBuild != "false" && env.BRANCH_NAME == "master"
}
}
steps {
sh "fastlane buildAppWithGym isProd:true"
}
}
desc "Upload to fabric beta"
lane :callCrashlytics do |options|
crashlytics(
crashlytics_path: "./Pods/Crashlytics/",
api_token: "**********************",
build_secret: "*************************",
ipa_path: "./myapp.ipa",
groups:"teamios",
notes:readme = File.read("./release_notes.txt"),
notifications:options[:isNotificationsOpen]
stage('Deploy to beta') {
when {
expression {
return env.shouldBuild != "false"
}
}
steps {
sh "fastlane callCrashlytics"
}
}
desc "Build application"
lane :buildAppWithGym do |options|
gym(
workspace: "MyApp.xcworkspace",
scheme: "MyAppScheme",
clean: true,
skip_profile_detection: true,
output_name: "myapp.ipa",
export_method: options[:isProd] ? "app-store" : "ad-hoc",
export_options:{