Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
PROTOC_VERSION := 3.17.2
PROTOC_RELEASE := https://github.com/protocolbuffers/protobuf/releases
PROTOC_URL := $(PROTOC_RELEASE)/download/v$(PROTOC_VERSION)/
PROTO_FILES := $(shell find . -name "*.proto" -type f)
PROTO_FILES := $(shell find server -name "*.proto" -type f)
PROTO_THIRDPARTY_FILES := $(shell find thirdparty -name "*.proto" -type f)
UNAME := $(shell uname)

PROTOC_ZIP_MACOS := protoc-$(PROTOC_VERSION)-osx-x86_64.zip
PROTOC_ZIP_LINUX := protoc-$(PROTOC_VERSION)-linux-x86_64.zip
PROTOC_ZIP_WINDOWS := protoc-$(PROTOC_VERSION)-win64.zip

ifeq ($(UNAME),Darwin)
PROTOC_FULL_URL := $(PROTOC_URL)/$(PROTOC_ZIP_MACOS)
PROTOC_FILE := $(PROTOC_ZIP_MACOS)
Expand All @@ -21,6 +21,8 @@ else ifeq ($(UNAME), Windows)
PROTOC_FILE := $(PROTOC_ZIP_WINDOWS)
endif

DART_MOCK_FILES := $(shell find client -name "*.mocks.dart" -type f)

.PHONY: install
install:
curl -OL $(PROTOC_FULL_URL)
Expand All @@ -38,6 +40,7 @@ gen.go:
mkdir -p ./server/pkg/protos/
protoc \
--proto_path=server \
--proto_path=thirdparty \
--go_out=server \
--go_opt=paths=source_relative \
--go-grpc_out=server \
Expand All @@ -46,18 +49,22 @@ gen.go:

.PHONY: gen.dart
gen.dart:
mkdir -p ./client/lib/protos/ && \
protoc \
--proto_path=server \
--dart_out=grpc:./client/lib/protos \
$(PROTO_FILES)
mkdir -p ./client/lib/protos/
protoc \
--proto_path=server \
--proto_path=thirdparty \
--dart_out=grpc:./client/lib/protos \
$(PROTO_FILES) $(PROTO_THIRDPARTY_FILES)

.PHONY: test
test: test.go test.dart

.PHONY: test.dart
test.dart:
cd client && flutter pub run build_runner build && flutter analyze && flutter test
test.dart: $(DART_MOCK_FILES)
cd client && flutter analyze && flutter test

$(DART_MOCK_FILES): $(DART_MOCK_FILES:.mocks.dart=.dart)
cd client && flutter pub run build_runner build

.PHONY: test.dart-e2e
test.dart-e2e:
Expand Down
83 changes: 83 additions & 0 deletions client/lib/protos/google/protobuf/timestamp.pb.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions client/lib/protos/google/protobuf/timestamp.pbenum.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions client/lib/protos/google/protobuf/timestamp.pbjson.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions client/lib/protos/pkg/pr12er/messages.pb.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/lib/protos/pkg/pr12er/messages.pbjson.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions client/lib/protos/pkg/pr12er/service.pb.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion client/lib/widgets/detail/header.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:pr12er/protos/pkg/pr12er/messages.pb.dart';

// ignore: must_be_immutable
Expand Down Expand Up @@ -62,7 +63,8 @@ class HeaderWidget extends StatelessWidget {
return [
const Icon(Icons.today),
const SizedBox(width: 8),
Text(video.publishedDate, style: const TextStyle(fontSize: 18))
Text(DateFormat.yMd().format(video.publishedDate.toDateTime()),
style: const TextStyle(fontSize: 18))
];
}
}
7 changes: 7 additions & 0 deletions client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
intl:
dependency: "direct main"
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.17.0"
io:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies:
flutter:
sdk: flutter
grpc: ^3.0.0
intl: ^0.17.0
protobuf: ^2.0.0
provider: ^5.0.0
youtube_player_flutter: ^8.0.0
Expand Down
Loading