Sign in

CI tanımlamalarında kullandığımız terminal scriptlerini işinize yarayabilir diye paylaşmak istedim:

Build başlamadan önce sürüm numarasını BuildNumber ile değiştirir:

((Get-Content -path $(System.DefaultWorkingDirectory)\pubspec.yaml -Raw) -replace ‘’(?<=version: \d.\d.\d.)(.*)’,$(Build.BuildNumber)) | Set-Content -Path $(System.DefaultWorkingDirectory)\pubspec.yaml

iOS build script:

flutter clean
flutter build ios
cd ios
xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphoneos -configuration Release archive -archivePath $PWD/build/Runner.xcarchive|
xcodebuild -exportArchive -archivePath $PWD/build/Runner.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build/Runner.ipa

Projenize eğer yoksa ExportOptions.plist eklemek için:

<?xml version=”1.0" encoding=”UTF-8"?>
<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version=”1.0"> …


I wanted to share the terminal scripts that we used in CI definitions so maybe it will useful to you.

It replaces the version number with build number before build starts:

((Get-Content -path $(System.DefaultWorkingDirectory)\pubspec.yaml -Raw) -replace ‘’(?<=version: \d.\d.\d.)(.*)’,$(Build.BuildNumber)) | Set-Content -Path $(System.DefaultWorkingDirectory)\pubspec.yaml

iOS build script:

flutter clean
flutter build ios
cd ios
xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphoneos -configuration Release archive -archivePath $PWD/build/Runner.xcarchive|
xcodebuild -exportArchive -archivePath $PWD/build/Runner.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build/Runner.ipa

To add ExportOption to your project if it doesn’t exist in your project.

<?xml version=”1.0" encoding=”UTF-8"?>
<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version=”1.0">
<dict>
<key>compileBitcode</key>
<true/>
<key>method</key>
<string>app-store</string>
<key>provisioningProfiles</key>
<dict>
<key>your_bundle_id</key>
<string>Provisioning Profiles Name</string>
</dict>
<key>signingCertificate</key>
<string>Certificate Name</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>TEAMID</string>
</dict></plist>…


I will share the little template I used to start a new flutter project step by step. Roughly it contains rest api builder, json result generator, http interceptor, navigation, global exception handling and bloc.

bool get isInDebugMode {
var inDebugMode = false;
assert(inDebugMode = true);
return inDebugMode;
}

Future<Null> main() async {
WidgetsFlutterBinding.ensureInitialized();
setupLocator();
FlutterError.onError = (FlutterErrorDetails details) async {
if (isInDebugMode) {
FlutterError.dumpErrorToConsole(details);
} else {
Zone.current.handleUncaughtError(details.exception, details.stack);
}
};

runZoned<Future<Null>>(() async {…


Yeni bir flutter projesine başlarken kullandığım ufak şablonu adım adım paylaşacağım. Kabaca içerdikleri rest api builder, json result generator, http interceptor, navigation, global exception handling ve bloc.

bool get isInDebugMode {
var inDebugMode = false;
assert(inDebugMode = true);
return inDebugMode;
}

Future<Null> main() async {
WidgetsFlutterBinding.ensureInitialized();
setupLocator();
FlutterError.onError = (FlutterErrorDetails details) async {
if (isInDebugMode) {
FlutterError.dumpErrorToConsole(details);
} else {
Zone.current.handleUncaughtError(details.exception, details.stack);
}
};

runZoned<Future<Null>>(() async {
Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {…


We had been looking for an alternative to Xamarin for a while, especially due to the performance issues on Android. However, this search did not last long after meeting Flutter. Yes, we have left Xamarin for a while. And I wanted to have some experience on the Flutter to be able to write this article

Why did we decide on this transition from Xamarin to Flutter?

CAUSES:

  • XF Roadmap: Compared to previous years, it does not focus on problems that are very incomplete. There are long-awaited bug issues (grows entry horizontally on iOS, spanning 3 in 4.5+ …

Bir süredir özellikle Android’deki performans sorunlarından dolayı Xamarin’e alternatif arayışımız vardı. Ancak Flutter ile tanışınca bu arayış çok uzun sürmedi. Evet Xamarin’i bir süredir terk etmiş durumdayız. Ve bu yazıyı yazmak için de Flutter tarafında da biraz tecrübe edineyim istedim.

Xamarin’den Flutter’a bu geçişe neden karar verdik?

Artılar:

  • XF Yol Haritası: Önceki yıllara kıyasla çok cılız ve asıl eksik olan sorunlara odaklanılmıyor. Uzun süredir açık bekleyen hata issue’ları da mevcut(iOS’ta entrylerin yana doğru uzaması, 4.5+ sürümde, span 3 verilen CollectionView’da 2 span’lık gibi davranması, dashboardlarımızı dolduran “MobileAuthenticatedStream” hataları gibi liste uzar gider.).
  • Hot Reload: Uzun yıllar bunun eksikliği ile geliştirme yaptık…


Azure Devops Xamarin build konfigurasyonlarında kullanmak için yazdığım 2 tane pratik powershell scripti var:

Unix timestamp üretip Android, iOS build numaralarını güncellemek:

$timestamp = [int](Get-Date -UFormat %s -Millisecond 0)
Write-Host “$(“##vso[task.setvariable variable=timestamp]”)$timestamp”

Android CI Yaml
iOS CI Yaml

Build’e ait ilişkili commit’leri almak için:

Read this post in English here.


I have 2 practical powershell scripts that I wrote to use in Azure Devops Xamarin build configurations:

Generate unix timestamp and replace Android, iOS build numbers with this timestamp:

$timestamp = [int](Get-Date -UFormat %s -Millisecond 0)
Write-Host “$(“##vso[task.setvariable variable=timestamp]”)$timestamp”

Android CI Yaml
iOS CI Yaml

To get the related commits from the build:

Bu yazının Türkçe haline buradan ulaşabilirsiniz.


Geliştirme yaptıkça zamanla biriken bazı fazlalıklar:

Visual Studio İndirme Cache’i => /Users/{user}/Library/Caches/VisualStudio/n/TempDownload

Kullanılmayan ama local’de kalmış branch’ler =>

git branch -r | awk ‘{print $1}’ | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk ‘{print $1}’ | xargs git branch -D

iOS Simulator Cache’leri =>

xcrun simctl delete unavailable
xcrun simctl erase all

Kullanılmayan .net runtime vs sdk’ları=>

dotnet — list-runtimes
dotnet — list-sdks
sudo rm -rf /usr/local/share/dotnet/sdk/1.0.1-

bin obj => Araçlar yazısında bahsettiğim Clean & Compress bin obj temizliği için.

Fazlalık Servisler

Gereksiz Windows servislerini kapatma=> Windows kurulumundan sonra yaptığım ilk hareket. İlgili servislerin listesi: https://www.askvg.com/beginners-guide-to-configure-windows-10-services/

Windows…


Some garbage which accumulates over time as we continue to develop:

Clean Visual Studio Download Cache=> /Users/{user}/Library/Caches/VisualStudio/n/TempDownload

Clean branches that are not used but remain in the local =>

git branch -r | awk ‘{print $1}’ | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk ‘{print $1}’ | xargs git branch -D

Clean iOS Simulator Cache =>

xcrun simctl delete unavailable
xcrun simctl erase all

Unused .net runtime and sdks=>

dotnet — list-runtimes
dotnet — list-sdks
sudo rm -rf /usr/local/share/dotnet/sdk/1.0.1-

bin obj => The tools I mentioned in the article Clean & Compress bin for cleaning…

Sermet

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store