remove_transformer 1.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 47

Remove Transformer

Pub

A simple dart transformer that removes content from files when building in release mode.

Usage

Add the dependency and transformer to your pubspec.yaml:

dev_dependencies:
  remove_transformer: ^1.0.0
 
transformers:
- remove_transformer

The order of the transformers determines the order they are run so remove_transformer will most likely need to be toward the top. The transformer only runs in release mode.

The transformer will remove content from files when it comes across the following strings.

  • remove:line - removes the entire line
  • remove:start / remove:end - removes all lines from remove:start to remove:end including the entirety of the start and end lines

Examples

Remove a line

String content = 'Debug content'; // remove:line

Remove a block

// remove:start
String str1 = 'Hello World';
String str2 = 'Goodnight Moon';
String str3 = 'err';
//remove:end

The following is an identical representation.

String str1 = 'Hello World'; // remove:start
String str2 = 'Goodnight Moon';
String str3 = 'err'; //remove:end

Change variables

// remove:start
String mode = 'debug';
String greeting = 'Hello World';
// remove:end
 
/* remove:line
String mode = 'release';
String greeting = 'Hello';
remove:line */

or

// remove:start
String mode = 'debug';
String greeting = 'Hello World';
/* remove:end
String mode = 'release';
String greeting = 'Hello';
remove:line */

In debug mode mode and greeting will have the values 'debug' and 'Hello World'. In release mode mode and greeting will have the values 'release' and 'Hello'.

Changelog

1.0.0

  • Initial version

1.0.1

  • Updated readme to be compatible with pub

1.0.2

  • Ignore files that are not UTF-8 encoded (caught a FormatException when reading the file) such as images

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  remove_transformer: "^1.0.2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:remove_transformer/remove_transformer.dart';
  
Version Uploaded Documentation Archive
1.0.2 Feb 14, 2018 Go to the documentation of remove_transformer 1.0.2 Download remove_transformer 1.0.2 archive
1.0.1 Feb 14, 2018 Go to the documentation of remove_transformer 1.0.1 Download remove_transformer 1.0.1 archive
1.0.0 Feb 14, 2018 Go to the documentation of remove_transformer 1.0.0 Download remove_transformer 1.0.0 archive

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
90 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
47
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:remove_transformer/remove_transformer.dart.

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 hints.

    Run dartfmt to format lib/remove_transformer.dart.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use remove_transformer.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
barback ^0.15.0 0.15.2+16
Transitive dependencies
async 2.0.7
charcode 1.1.1
collection 1.14.10
path 1.6.1
pool 1.3.5
source_span 1.4.0
stack_trace 1.9.2
Dev dependencies
mockito ^2.2.0
test ^0.12.0