Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completed more and about screen #293

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 52 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,44 @@ jobs:
- os: windows-latest
target: windows
build_path: build\windows\x64\runner\Release
- os: windows-latest
target: windows-arm64
build_path: build\windows\arm64\runner\Release

steps:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
# Install Linux dependencies
- name: Install Linux dependencies
if: matrix.target == 'linux'
run: |
sudo apt-get update -y
sudo apt-get install -y libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev

# Install Android dependencies
- name: Install Android dependencies
if: matrix.target == 'android'
uses: actions/setup-java@v3
with:
distribution: 'zulu'
distribution: "zulu"
java-version: "12.x"

# Enable desktop support
- name: Enable desktop support
if: matrix.target != 'android' && matrix.target != 'ios' && matrix.target != 'web'
run: |
flutter config --enable-linux-desktop
flutter config --enable-macos-desktop
flutter config --enable-windows-desktop

# Recreating the project
- run: flutter doctor -v
- uses: actions/checkout@v3
# - run: flutter create .
- run: flutter pub get

# Configure Keystore for Android
- name: Configure Keystore for Android
if: matrix.target == 'android'
working-directory: android
Expand All @@ -76,22 +86,37 @@ jobs:
echo "storePassword=${{ secrets.KEYSTORE_STORE_PASSWORD }}" >> key.properties
echo "keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> key.properties

# Build the project for the target platform
- if: matrix.target != 'android' && matrix.target != 'ios'
run: flutter build ${{ matrix.target }} --release

- if: matrix.target == 'android'
run: |
flutter build apk --release
flutter build apk --split-per-abi --release

- if: matrix.target == 'ios'
run: flutter build ios --release --no-codesign

# Windows packaging
- name: Copy VC redistributables to release directory for Windows
if: matrix.target == 'windows'
working-directory: ${{ matrix.build_path }}
run: |
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140.dll') .
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140.dll') .
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140_1.dll') .

# Windows packaging
- name: Copy VC redistributables to release directory for Windows
if: matrix.target == 'windows-arm64'
working-directory: ${{ matrix.build_path }}
run: |
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\arm64\*\msvcp140.dll') .
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\arm64\*\vcruntime140.dll') .
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\arm64\*\vcruntime140_1.dll') .

# Android packaging
- name: Rename build for Android
if: matrix.target == 'android'
working-directory: ${{ matrix.build_path }}
Expand Down Expand Up @@ -126,6 +151,7 @@ jobs:
cp "$GITHUB_WORKSPACE/assets/icons/launcher/sorayomi_icon.png" "./${{ env.pkg_name }}.png"
GZIP=-9 tar czf "$GITHUB_WORKSPACE/${{ env.pkg_name }}-${{ github.ref_name }}-${{ matrix.target }}-x64.tar.gz" *

# Debian packaging
- name: Build deb package
if: matrix.target == 'linux'
run: |
Expand All @@ -143,14 +169,24 @@ jobs:
debuild --no-lintian -us -uc
cp "../${{ env.pkg_name }}_${{ github.ref_name }}-1_amd64.deb" "$GITHUB_WORKSPACE/"

# macOS packaging
- name: Compress build for macOS
if: matrix.target == 'macos'
working-directory: ${{ matrix.build_path }}
run: ditto -c -k --sequesterRsrc --keepParent "Tachidesk Sorayomi.app" "$GITHUB_WORKSPACE/${{ env.pkg_name }}-${{ github.ref_name }}-${{ matrix.target }}-x64.zip"
run: ditto -c -k --sequesterRsrc --keepParent "Sorayomi.app" "$GITHUB_WORKSPACE/${{ env.pkg_name }}-${{ github.ref_name }}-${{ matrix.target }}-x64.zip"

# Windows packaging
- name: Compress build for Windows
if: matrix.target == 'windows'
working-directory: ${{ matrix.build_path }}
run: compress-archive -Path * -DestinationPath "${env:GITHUB_WORKSPACE}\${{ env.pkg_name }}-${{ github.ref_name }}-${{ matrix.target }}-x64.zip"

# Windows packaging
- name: Compress build for Windows
if: matrix.target == 'windows'
working-directory: ${{ matrix.build_path }}
run: compress-archive -Path * -DestinationPath "${env:GITHUB_WORKSPACE}\${{ env.pkg_name }}-${{ github.ref_name }}-${{ matrix.target }}-arm64.zip"

- name: Create MSI Package
if: matrix.target == 'windows' && startsWith(github.ref, 'refs/tags/')
working-directory: ${{ matrix.build_path }}
Expand All @@ -164,6 +200,19 @@ jobs:
light -b data "${{ env.pkg_name }}-x64.wixobj" data.wixobj -o "${{ env.pkg_name }}-${{ github.ref_name }}-${{ matrix.target }}-x64.msi"
Move-Item "${{ env.pkg_name }}-${{ github.ref_name }}-${{ matrix.target }}-x64.msi" "${env:GITHUB_WORKSPACE}"

- name: Create arm64 MSI Package
if: matrix.target == 'windows-arm64' && startsWith(github.ref, 'refs/tags/')
working-directory: ${{ matrix.build_path }}
run: |
$env:Path += ";C:\Program Files (x86)\WiX Toolset v3.11\bin"
$upgradeCode = [guid]::NewGuid().Guid
Copy-Item "${env:GITHUB_WORKSPACE}\scripts\${{ env.pkg_name }}-arm64.wxs" .
Copy-Item "${env:GITHUB_WORKSPACE}\assets\icons\launcher\sorayomi_icon.ico" .
heat dir data -cg data -dr data -sreg -sfrag -gg -o data.wxs
candle -arch arm64 -dVersion="${{ github.ref_name }}" -dUpgradeCode="$upgradeCode" -dIcon="sorayomi_icon.ico" "${{ env.pkg_name }}-arm64.wxs" data.wxs
light -b data "${{ env.pkg_name }}-arm64.wixobj" data.wixobj -o "${{ env.pkg_name }}-${{ github.ref_name }}-${{ matrix.target }}-arm64.msi"
Move-Item "${{ env.pkg_name }}-${{ github.ref_name }}-${{ matrix.target }}-arm64.msi" "${env:GITHUB_WORKSPACE}"

- name: Add packaged build to release draft
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2022 Contributors to the Suwayomi project
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Expand All @@ -23,4 +23,4 @@ jobs:
channel: 'stable'
- uses: bluefireteam/flutter-gh-pages@v7
with:
baseHref: /Tachidesk-Sorayomi/
baseHref: /Tachidesk-Sorayomi/
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"reddy",
"Scanlator",
"scanlators",
"Solverr",
"sublist",
"suwayomi",
"tachidesk",
Expand All @@ -27,5 +28,15 @@
],
"licenser.license": "MPLv2",
"licenser.projectName": "Tachidesk-Sorayomi",
"licenser.author": "Contributors to the Suwayomi project"
"licenser.author": "Contributors to the Suwayomi project",
"files.exclude": {
"**/__generated__": true,
"**/*.ast.gql.dart": true,
"**/*.data.gql.dart": true,
"**/*.freezed.dart": true,
"**/*.g.dart": true,
"**/*.gql.g.dart": true,
"**/*.req.gql.dart": true,
"**/*.var.gql.dart": true
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<p align="center">
<img width=200px height=200px src="assets/icons/launcher/sorayomi_icon.png" alt="Tachidesk Sorayomi logo"/>
<img width=200px height=200px src="assets/icons/launcher/sorayomi_icon.png" alt="Sorayomi logo"/>
</p>

DattatreyaReddy marked this conversation as resolved.
Show resolved Hide resolved
<h1 align="center"> Tachidesk Sorayomi </h1>
<h1 align="center"> Sorayomi </h1>

<div align="center">

Expand Down
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ analyzer:
- "**/*.gform.dart"
- "**/*.g.dart"
- "**/*.freezed.dart"
- "**/*.gql.dart"

errors:
invalid_annotation_target: ignore
invalid_annotation_target: ignore
19 changes: 7 additions & 12 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,10 +22,6 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
Expand Down Expand Up @@ -78,6 +75,4 @@ flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
dependencies {}
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package="com.suwayomi.tachidesk_sorayomi">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="Tachidesk Sorayomi"
android:label="Sorayomi"
android:name="${applicationName}"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="@xml/network_security_config"
Expand Down
13 changes: 0 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.8.20'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand Down
33 changes: 25 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
id "com.google.firebase.crashlytics" version "2.9.9" apply false
}

include ":app"
21 changes: 20 additions & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,23 @@ targets:
builders:
json_serializable:
options:
explicit_to_json: true
explicit_to_json: true
ferry_generator|graphql_builder:
enabled: true
options:
schema: tachidesk_sorayomi|lib/src/graphql/schema.graphql
type_overrides:
Upload:
name: MultipartFile
import: 'package:http/http.dart'
ferry_generator|serializer_builder:
enabled: true
options:
schema: tachidesk_sorayomi|lib/src/graphql/schema.graphql
type_overrides:
Upload:
name: MultipartFile
import: 'package:http/http.dart'
custom_serializers:
- import: 'package:tachidesk_sorayomi/src/utils/misc/upload_serializer.dart'
name: UploadSerializer
2 changes: 1 addition & 1 deletion ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Tachidesk Sorayomi</string>
<string>Sorayomi</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down
8 changes: 7 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@

import 'dart:io';

import 'package:ferry_hive_store/ferry_hive_store.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:path/path.dart' as path;
Expand All @@ -24,7 +26,11 @@ Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final packageInfo = await PackageInfo.fromPlatform();
final sharedPreferences = await SharedPreferences.getInstance();
await Hive.initFlutter('Sorayomi');
final box = await Hive.openBox("graphql");
final store = HiveStore(box);

//TODO remove
final Directory? appDirectory;
if (!kIsWeb) {
final appDocDirectory = await getApplicationDocumentsDirectory();
Expand All @@ -48,13 +54,13 @@ Future<void> main() async {

SystemChrome.setPreferredOrientations(DeviceOrientation.values);
GoRouter.optionURLReflectsImperativeAPIs = true;

runApp(
ProviderScope(
overrides: [
packageInfoProvider.overrideWithValue(packageInfo),
sharedPreferencesProvider.overrideWithValue(sharedPreferences),
appDirectoryProvider.overrideWithValue(appDirectory),
hiveStoreProvider.overrideWithValue(store)
],
child: const Sorayomi(),
),
Expand Down
12 changes: 12 additions & 0 deletions lib/src/abstracts/locale_enum.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:flutter/material.dart';

import 'value_enum.dart';

abstract interface class LocaleEnum implements ValueEnum {
LocaleEnum(this.value);

@override
final String value;

String toLocale(BuildContext context);
}
5 changes: 5 additions & 0 deletions lib/src/abstracts/value_enum.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
abstract interface class ValueEnum implements Enum {
ValueEnum(this.value);

final String value;
}
Loading