Skip to content

Commit

Permalink
release/0.1.0 - BrickHub update (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
yardexx authored Dec 24, 2022
1 parent 199b6e2 commit a4774b0
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/brick_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Very Good Workflow
name: Brick Workflow

on:
workflow_dispatch:
Expand Down
58 changes: 35 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
# 0.0.1-dev.1

**🎉 Initial version of freerasp_brick 🎉**
## ✨ Features
- 🛠 Configuration generation
- 🎯 Dependency check using `pub get`
- 🔧 Fix apply using `dart fix`

# 0.0.1-dev.2
## ✨ New Features
- Automatic dependency fetching using `pub add`
# 0.1.0
**🎉 First release on BrickHub.dev! 🎉**

## 🎯 Improvements
- Unified CLI prompt design
- Expanded README.md
- Code checked
- Updated README
- Reformatted CHANGELOG
- Updated prompt messages

## 🛠 Fixed issues
- Typos in README.md
- Properly showing progress message when successfully added script (iOS)

# 0.0.1-dev.5
## ✨ New Features
- Optional automatic iOS script insertion in Runner.xcscheme - experimental (iOS)

# 0.0.1-dev.3
## 🎯 Improvements
- GitHub actions
- Code analysis
- Updated README

## 🛠 Fixed issues
- Dynamic types
- Fixed incorrect `mason` version in `brick.yaml`
- Specified explicit `mason` version to `>=0.1.0-dev.39` in `pubspec.yaml`

# 0.0.1-dev.4
## ✨ New Features
Expand All @@ -33,13 +29,29 @@
- Updated README
- Updated CHANGELOG (uhm... sorry about that 😅)

# 0.0.1-dev.5
# 0.0.1-dev.3
## 🎯 Improvements
- GitHub actions
- Code analysis

## 🛠 Fixed issues
- Dynamic types

# 0.0.1-dev.2
## ✨ New Features
- Optional automatic iOS script insertion in Runner.xcscheme - experimental (iOS)
- Automatic dependency fetching using `pub add`

## 🎯 Improvements
- Updated README
- Unified CLI prompt design
- Expanded README.md

## 🛠 Fixed issues
- Fixed incorrect `mason` version in `brick.yaml`
- Specified explicit `mason` version to `>=0.1.0-dev.39` in `pubspec.yaml`
- Typos in README.md

# 0.0.1-dev.1

**🎉 Initial version of freerasp_brick 🎉**
## ✨ Features
- 🛠 Configuration generation
- 🎯 Dependency check using `pub get`
- 🔧 Fix apply using `dart fix`
69 changes: 43 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
<a href="https://codecov.io/gh/yardexx/freerasp_brick"><img src="https://codecov.io/gh/yardexx/freerasp_brick/branch/master/graph/badge.svg?token=300N5C20OB"/></a>
<a href="https://pub.dev/packages/very_good_analysis"><img src="https://img.shields.io/badge/style-very_good_analysis-B22C89.svg" alt="style: very good analysis"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-purple.svg" alt="License: MIT"></a>
</p>
</p>

<p align="center">
A brick for <a href="https://pub.dev/packages/freerasp">freeRASP</a> to generate configuration code
and automate necessary code checks.
and automate necessary setup.
</p>

> 🚧 This brick is experimental and not stable! Changes to API/file generation reserved.
> ⚠ This brick is supported for mason version `>=0.1.0-dev.40`.
## Overview
Setting up freeRASP can be quite tedious and repetitive. freerasp_brick provides you error-proof
way to create configuration.
Expand All @@ -30,60 +28,79 @@ way to create configuration.
- 🍎 iOS script insertion in Runner.xcscheme (Experimental)

## How to add ➕
This brick is currently **NOT** available on [brickhub.dev](https://brickhub.dev/).

For now, you can add via git-url:
### Using BrickHub.dev
You can add freerasp_brick to your project just like any other brick:
```shell
mason add freerasp_brick
```

### Using GitHub dependency
You can also add freerasp_brick to your project using `--git-url` option:
```shell
mason add --git-url https://github.com/yardexx/freerasp_brick freerasp_brick
```

Globally available:
```
mason add -g --git-url https://github.com/yardexx/freerasp_brick freerasp_brick
```
> 💡 If you plan to use freeRASP in many different projects, it's useful to have freerasp_brick as global brick. You can do it by adding `--global` option.
## How to use 🚀

Generate configuration:
```
You can generate freeRASP configuration by running:
```shell
mason make freerasp_brick
```

Import it and call `start()`:
After providing necessary information, freerasp_brick will generate following file structure:
```
freerasp
├── freerasp.g.dart
└── freerasp_callback.g.dart
```

Then simply import `freerasp.g.dart` in your desired file and use it:
```dart
import 'freerasp/freerasp.g.dart';
// Some other code...
talsec.start();
```

You can edit `freerasp_callback.g.dart` to provide own reactions or made your own `TalsecCallback`
and provide it in `freerasp.g.dart`;
## Generated reactions 💣

Default generated reaction for every callback is `print` to console.

If you wish to change it, you can do so by editing `freerasp_callback.g.dart` file.

## Variables 📦
| Variable | Description | Default | Type | Conditional | When |
|--------------|-------------------------------|-----------------|--------|-------------|-----------------|
| watcher_mail | An email for security reports | N/A | String | false | N/A |
| android | Add Android configuration | true | bool | false | N/A |
| package_name | Android app package name | com.example.app | String | true | android == true |
| signing_hash | Android app signing hash | N/A | String | true | android == true |
| ios | Add iOS configuration | true | bool | false | N/A |
| bundle_id | iOS app id | com.example.app | String | true | ios == true |
| team_id | iOS team id | N/A | String | true | ios == true |
| Variable | Description | Default | Type | Conditional | When |
|---------------|-------------------------------|-----------------|--------|-------------|-----------------|
| watcher_mail | An email for security reports | N/A | String | false | N/A |
| android | Add Android configuration | true | bool | false | N/A |
| package_name | Android app package name | com.example.app | String | true | android == true |
| signing_hash | Android app signing hash | N/A | String | true | android == true |
| update_gradle | Update build.gradle file | true | bool | true | android == true |
| ios | Add iOS configuration | true | bool | false | N/A |
| bundle_id | iOS app id | com.example.app | String | true | ios == true |
| team_id | iOS team id | N/A | String | true | ios == true |
| update_scheme | Update Runner.xcscheme file | true | bool | true | ios == true |

> ⚠ Since freerasp_brick is heavily dependent on hooks, using `-c` option won't skip prompts generated by hooks.
## Hooks 🎣
| Type | Enabled | Can be disabled |
|----------|---------|-----------------|
| pre-gen |||
| post-gen |||

> ⚠ Brick can behave unexpectedly if pre-gen or post-gen hooks are disabled.
> ⚠ Brick won't generate files correctly if you disable `pre-gen` or `post-gen` hook.
## Contribution 🤝
For issues, bugs, or feature proposals feel free to [open issue](https://github.com/yardexx/freerasp_brick/issues)
or [create PR](https://github.com/yardexx/freerasp_brick/pulls).

## Useful resources 📚
If this is your first touch with freeRASP or Mason, please refer to resources to get started
If this is your first touch with freeRASP or Mason, you refer to these resources to get started:

### Getting started with [freeRASP][freerasp-pubdev] 🛡
- [freeRASP on GitHub][freerasp-github]
Expand Down
6 changes: 5 additions & 1 deletion hooks/post_gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ Future<void> _runSchemeCheck(HookContext context) async {
}

try {
SchemeUpdater.update(
final hasUpdated = SchemeUpdater.update(
'ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme',
);

if (hasUpdated) {
progress.complete('Runner.xcscheme successfully updated');
}
} catch (e) {
progress.fail("Couldn't update xcscheme");
}
Expand Down
2 changes: 1 addition & 1 deletion hooks/pre_gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void parseCupertinoData(HookContext context) {
);

final updateScheme = logger.masonConfirm(
'Do you want to update Runner.xcscheme?',
'Do you want to update Runner.xcscheme? (Experimental)',
defaultValue: true,
);

Expand Down

0 comments on commit a4774b0

Please sign in to comment.