move some stuff around, adopt 'just', keep pubspec from accidentally publishing

This commit is contained in:
John Smith
2022-01-17 13:44:38 -05:00
parent 22f4fad733
commit e39835d51f
6 changed files with 17 additions and 32 deletions

View File

@@ -1,7 +1,8 @@
name: veilid
description: Veilid Network
version: 0.0.1
homepage:
homepage: https://veilid.com
publish_to: "none" # Remove this line if you wish to publish to pub.dev
environment:
sdk: ">=2.15.1 <3.0.0"

View File

@@ -0,0 +1,63 @@
@ECHO OFF
SETLOCAL
PUSHD %~dp0
SET ROOTDIR=%CD%
POPD
REM ensure flutter is installed
FOR %%X IN (flutter.bat) DO (SET FLUTTER_FOUND=%%~$PATH:X)
IF NOT DEFINED FLUTTER_FOUND (
echo Flutter is not available in the path, install Flutter from here: https://docs.flutter.dev/get-started/install
goto end
)
echo [X] Flutter is available in the path
REM ensure dart is installed
FOR %%X IN (dart.bat) DO (SET DART_FOUND=%%~$PATH:X)
IF NOT DEFINED DART_FOUND (
echo Dart is not available in the path, check your environment variables and that Flutter is installed correctly
goto end
)
echo [X] Dart is available in the path
REM ensure cargo is installed
FOR %%X IN (cargo.exe) DO (SET CARGO_FOUND=%%~$PATH:X)
IF NOT DEFINED CARGO_FOUND (
echo Cargo is not available in the path, ensure Rust is installed correctly
goto end
)
echo [X] Cargo is available in the path
REM ensure winget is installed
FOR %%X IN (winget.exe) DO (SET WINGET_FOUND=%%~$PATH:X)
IF NOT DEFINED WINGET_FOUND (
echo Winget is not available in the path, ensure your version of Windows is new enough and has Winget installed from the Microsoft Store
echo https://docs.microsoft.com/en-us/windows/package-manager/winget/
goto end
)
echo [X] Winget is available in the path
rem install cargo cbindgen
cargo install cbindgen
rem install dart ffigen
call dart pub global activate ffigen
rem install flutter_rust_bridge_codegen
cargo install flutter_rust_bridge_codegen
rem install just
cargo install just
rem ensure packages are installed
winget install -e --id LLVM.LLVM --accept-package-agreements --accept-source-agreements
rem ensure windows is enabled in flutter
call flutter config --enable-windows-desktop --no-enable-android
rem turn off analytics
call flutter config --no-analytics
call dart --disable-analytics
call flutter doctor -v

83
veilid-flutter/setup_flutter.sh Executable file
View File

@@ -0,0 +1,83 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
OS="unknown"
if [ "$(uname)" == "Linux" ]; then
if [ ! "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then
echo Not a supported Linux
exit 1
fi
OS="linux"
elif [ "$(uname)" == "Darwin" ]; then
OS="macos"
fi
if [ "$OS" == "unknown" ]; then
echo "Not a supported operating system for this script"
exit 1
fi
# ensure flutter is installed
if command -v flutter &> /dev/null; then
echo '[X] Flutter is available in the path'
else
echo 'Flutter is not available in the path, install Flutter from here: https://docs.flutter.dev/get-started/install'
exit 1
fi
# ensure dart is installed
if command -v dart &> /dev/null; then
echo '[X] Dart is available in the path'
else
echo 'Dart is not available in the path, check your environment variables and that Flutter is installed correctly'
exit 1
fi
# ensure cargo is installed
if command -v cargo &> /dev/null; then
echo '[X] Cargo is available in the path'
else
echo 'Cargo is not available in the path, ensure Rust is installed correctly'
exit 1
fi
# install cargo cbindgen
cargo install cbindgen
# install dart ffigen
dart pub global activate ffigen
# install flutter_rust_bridge_codegen
cargo install flutter_rust_bridge_codegen
# install just
cargo install just
# platform specific stuff
if [ "$OS" == "linux" ]; then
# ensure packages are installed
echo "Must sudo to root to install LLVM package:"
sudo apt-get install libclang-dev
# ensure platforms are enabled in flutter
flutter config --enable-linux-desktop --enable-android
elif [ "$OS" == "macos" ]; then
# ensure packages are installed
if [ "$BREW_USER" == "" ]; then
BREW_USER=`ls -lad /opt/homebrew/. | cut -d\ -f4`
echo "Must sudo to homebrew user \"$BREW_USER\" to install LLVM package:"
fi
sudo -H -u $BREW_USER brew install llvm
echo "Must sudo to root to install CocoaPods gem:"
sudo gem install cocoapods
# ensure platforms are enabled in flutter
flutter config --enable-macos-desktop --enable-ios --no-enable-android
fi
# turn off analytics
flutter config --no-analytics
dart --disable-analytics
# run flutter doctor
flutter doctor -v