Skip to content

Commit

Permalink
migrating a few gradle build scripts to kotlin.
Browse files Browse the repository at this point in the history
  • Loading branch information
hpoul committed May 22, 2024
1 parent dc7a0bd commit 3e37d9e
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 97 deletions.
62 changes: 0 additions & 62 deletions authpass/android/build.gradle

This file was deleted.

35 changes: 35 additions & 0 deletions authpass/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
if (System.getProperty("design.codeux.ndkVersion") == null) {
// println("Setting ndkVersion")
if (rootProject.hasProperty("design.codeux.ndkVersion")) {
System.setProperty("design.codeux.ndkVersion", rootProject.property("design.codeux.ndkVersion").toString())
} else {
System.setProperty("design.codeux.ndkVersion", "25.1.8937393")
}
}
println("ndkVersion: ${System.getProperty("design.codeux.ndkVersion")}")

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.layout.buildDirectory.set(File("../build"))
subprojects {
project.layout.buildDirectory.set(rootProject.layout.buildDirectory.get().dir(project.name))
}
subprojects {
project.evaluationDependsOn(":app")
if (project.path == ":file_picker_writable" || project.path == ":flutter_email_sender") {
apply(plugin = "com.android.library")
apply(plugin = "kotlin-android")
project.configure<org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension> {
jvmToolchain(17)
}
}
}

tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory.get())
}
26 changes: 0 additions & 26 deletions authpass/android/settings.gradle

This file was deleted.

26 changes: 26 additions & 0 deletions authpass/android/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pluginManagement {
fun flutterSdkPath(): String {
val properties = java.util.Properties()
java.io.File("local.properties").inputStream().use { properties.load(it) }
val flutterSdkPath = properties.getProperty("flutter.sdk")
assert(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
return flutterSdkPath
}
settings.extra.set("flutterSdkPath", flutterSdkPath())

includeBuild("${settings.extra.get("flutterSdkPath")}/packages/flutter_tools/gradle")

repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.4.0" apply false
id("org.jetbrains.kotlin.android") version "1.8.10" apply false
}

include(":app")
4 changes: 2 additions & 2 deletions authpass/lib/ui/screens/cloud/cloud_mail_read.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:logging/logging.dart';
import 'package:open_file/open_file.dart';
import 'package:open_filex/open_filex.dart';
import 'package:provider/provider.dart';
import 'package:string_literal_finder_annotations/string_literal_finder_annotations.dart';

Expand Down Expand Up @@ -117,7 +117,7 @@ class _EmailReadScreenState extends State<EmailReadScreen> {
dirPrefix: nonNls('openbinary'),
fileName: a.fileName!);
_logger.fine('Opening ${f.path}');
final result = await OpenFile.open(f.path);
final result = await OpenFilex.open(f.path);
_logger.fine('finished opening $result');
},
child: ListTile(
Expand Down
4 changes: 2 additions & 2 deletions authpass/lib/ui/screens/entry_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:kdbx/kdbx.dart';
import 'package:logging/logging.dart';
import 'package:mime/mime.dart';
import 'package:open_file/open_file.dart';
import 'package:open_filex/open_filex.dart';
import 'package:otp/otp.dart';
import 'package:otpauth_migration/otpauth_migration.dart';
import 'package:path/path.dart' as path;
Expand Down Expand Up @@ -885,7 +885,7 @@ class AttachmentBottomSheet extends StatelessWidget {
final f = await PathUtils().saveToTempDirectory(bytes,
dirPrefix: 'openbinary', fileName: attachment.key.key);
_logger.fine('Opening ${f.path}');
final result = await OpenFile.open(f.path);
final result = await OpenFilex.open(f.path);
_logger.fine('finished opening $result');
},
),
Expand Down
8 changes: 4 additions & 4 deletions authpass/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1247,14 +1247,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.0+6"
open_file:
open_filex:
dependency: "direct main"
description:
name: open_file
sha256: a5a32d44acb7c899987d0999e1e3cbb0a0f1adebbf41ac813ec6d2d8faa0af20
name: open_filex
sha256: "74e2280754cf8161e860746c3181db2c996d6c1909c7057b738ede4a469816b8"
url: "https://pub.dev"
source: hosted
version: "3.3.2"
version: "4.4.0"
openapi_base:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion authpass/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ dependencies:
# ref: 036c3e387d32d3c8b2f5b3a3ebedb55c6eb69c30
# https://github.com/crazecoder/open_file/pull/258
# TODO: If update is available, remove namespace workaround from build.gradle
open_file: ^3.3.2
open_filex: ^4.4.0
# open_file:
# git:
# url: https://github.com/kishormainali/open_file.git
Expand Down

0 comments on commit 3e37d9e

Please sign in to comment.