From 887a0638cd47a0ee738304d372512f9a1b91fa6b Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 2 Feb 2025 16:21:44 -0700 Subject: [PATCH] Add web build to CI schedule --- Jenkinsfile | 4 ++ compile.sh | 1 + lib/Consts2.dart | 2 +- lib/Editor.dart | 8 ++- lib/pages/EditValue.dart | 55 ------------------- lib/pages/SNBTEditor.dart | 6 +- macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.yaml | 5 +- 8 files changed, 21 insertions(+), 62 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4f7f881..140ce47 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,6 +30,10 @@ pipeline { cd ../../../../ + cd build/web + tar -cvf ../../web.tgz . + cd ../.. + #appimage-builder --recipe AppImageBuilder.yml #appimagetool AppDir/*.desktop -u "zsync|https://ci.zontreck.com/job/Projects/job/Dart/job/NBTEditor/job/main/lastSuccessfulBuild/artifact/NBT%20Editor-latest-x86_64.AppImage.zsync" diff --git a/compile.sh b/compile.sh index 5971e90..0edfee5 100755 --- a/compile.sh +++ b/compile.sh @@ -2,6 +2,7 @@ flutter build linux flutter build apk +flutter build web if [ ! -d out ] then diff --git a/lib/Consts2.dart b/lib/Consts2.dart index c494f71..d2c2374 100644 --- a/lib/Consts2.dart +++ b/lib/Consts2.dart @@ -1 +1 @@ -const VERSION = "1.1.012425+0821"; +const VERSION = "1.1.020225+1616"; diff --git a/lib/Editor.dart b/lib/Editor.dart index 0b5452f..fc12590 100644 --- a/lib/Editor.dart +++ b/lib/Editor.dart @@ -11,6 +11,7 @@ import 'package:libac_dart/nbt/impl/ByteArrayTag.dart'; import 'package:libac_dart/nbt/impl/CompoundTag.dart'; import 'package:libac_dart/nbt/impl/IntArrayTag.dart'; import 'package:libac_dart/nbt/impl/LongArrayTag.dart'; +import 'package:libacflutter/Prompt.dart'; import 'package:nbteditor/Constants.dart'; import 'package:nbteditor/Consts2.dart'; import 'package:nbteditor/SessionData.dart'; @@ -77,9 +78,10 @@ class EditorState extends State { context: context, builder: (dialogBuilder) { return InputPrompt( - titleText: "What tag name to search for?", - PromptText: - "Enter the tag name you want to search for"); + title: "What tag name to search for?", + prompt: + "Enter the tag name or value you want to search for", + type: InputPromptType.Text); }); }, icon: const Icon(CupertinoIcons.search_circle)) diff --git a/lib/pages/EditValue.dart b/lib/pages/EditValue.dart index 5e3a8fa..1db4b39 100644 --- a/lib/pages/EditValue.dart +++ b/lib/pages/EditValue.dart @@ -2,61 +2,6 @@ import 'package:flutter/material.dart'; import 'package:libac_dart/nbt/Tag.dart'; import 'package:libac_dart/nbt/impl/StringTag.dart'; -class InputPrompt extends StatefulWidget { - String titleText; - String PromptText; - String value; - InputPrompt( - {required this.titleText, - required this.PromptText, - super.key, - this.value = ""}); - - @override - State createState() { - return InputPromptState( - title: Text(titleText), prompt: Text(PromptText), value: value); - } -} - -class InputPromptState extends State { - final Widget title; - final Widget prompt; - TextEditingController _editor = TextEditingController(); - - InputPromptState({required this.title, required this.prompt, String? value}) { - if (value != null) _editor.text = value; - } - - @override - Widget build(BuildContext context) { - return AlertDialog( - title: title, - actions: [ - ElevatedButton( - onPressed: () async { - Navigator.pop(context, _editor.text); - }, - child: Text("Confirm")), - ElevatedButton( - onPressed: () async { - Navigator.pop(context, ""); - }, - child: Text("Cancel")) - ], - content: SizedBox( - width: 200, - height: 100, - child: Column(children: [ - prompt, - TextField( - controller: _editor, - ) - ]), - )); - } -} - class EditValuePrompt extends StatefulWidget { const EditValuePrompt({super.key}); diff --git a/lib/pages/SNBTEditor.dart b/lib/pages/SNBTEditor.dart index 2fcb9eb..b685405 100644 --- a/lib/pages/SNBTEditor.dart +++ b/lib/pages/SNBTEditor.dart @@ -4,6 +4,7 @@ import 'package:flutter_code_editor/flutter_code_editor.dart'; import 'package:flutter_highlight/themes/vs.dart'; import 'package:libac_dart/nbt/SnbtIo.dart'; import 'package:libac_dart/nbt/impl/CompoundTag.dart'; +import 'package:libacflutter/Prompt.dart'; import 'package:nbteditor/Constants.dart'; import 'package:nbteditor/SessionData.dart'; import 'package:nbteditor/pages/EditValue.dart'; @@ -40,8 +41,9 @@ class SnbtState extends State { context: context, builder: (searchBuilder) { return InputPrompt( - titleText: "Search", - PromptText: "What do you want to search for?"); + title: "Search", + prompt: "What do you want to search for?", + type: InputPromptType.Text); }); }, icon: Icon(CupertinoIcons.search)) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 8236f57..9e433e9 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,8 +5,10 @@ import FlutterMacOS import Foundation +import file_picker import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.yaml b/pubspec.yaml index 883164d..450eeee 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: nbteditor description: A Minecraft NBT Editor written in Flutter publish_to: "none" -version: 1.1.012425+0821 +version: 1.1.020225+1616 environment: sdk: ^3.6.1 @@ -20,6 +20,9 @@ dependencies: hosted: https://git.zontreck.com/api/packages/AriasCreations/pub/ version: ^1.1.2 permission_handler: ^11.3.1 + libacflutter: + hosted: https://git.zontreck.com/api/packages/AriasCreations/pub/ + version: ^1.0.013125+1423 dev_dependencies: flutter_test: