citrus 0.1.0
citrus: ^0.1.0 copied to clipboard
A template generator which complex file structures can be defined in a single Yaml File.
Citrus
A template generator which complex file structures can be defined in a single Yaml File.
Example #
create dart package #
permanently: ['applicationName', 'applicationDescription']
template:
'{applicationName.snake}':
lib:
src:
'{applicationName.snake}.dart': ''
test:
.gitignore: |
# Files and directories created by pub
.dart_tool/
.packages
# Omit commiting pubspec.lock for library packages:
# https://dart.cn/guides/libraries/private-files#pubspeclock
pubspec.lock
# Conventional directory for build outputs
build/
# Directory created by dartdoc
doc/api/
analysis_options.yaml: |
analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
CHANGELOG.md: |
## 0.1.0
- Initial version
pubspec.yaml: |
name: {applicationName.snake}
description: {applicationDescription}
environment:
sdk: '^3.7.0'
dev_dependencies:
lints: ^6.0.0
test: ^1.25.8
README.md: |
# {applicationName.capital}
citrus generate --generateLocation <Any Location> --generateMode complement --templateFilePath <Path of the above YamlFile> --applicationName 'sample project' --applicationDescription 'this project is citrus result sample.'
create dart class file #
permanently: ['projectName', 'className', 'copyrightYear', 'licenseStyle']
list: ['descriptions', 'properties']
fragment:
copyright: |
// Copyright (C) {copyrightYear}, the {projectName.no} project authors.
// Please see the AUTHORS file for details.
// All rights reserved.
// Use of this source code is governed by a {licenseStyle.constant}-style license that can be found in the LICENSE file.
classDocComment: |-
/// {@template {className.pascal}}{#for i in descriptions}
/// {i}<br>{#for}
/// {@endtemplate}
template:
'{className.snake}.dart': |
{copyright}
{#if descriptions.isNotEmpty}{classDocComment}{#if}
class {className.pascal} {
{#for property in properties}final Object {property.camel};
{#for}
{className.pascal}({#for property in properties}this.{property.camel}, {#for});
}
citrus generate --generateLocation <Any Location> --generateMode complement --templateFilePath <Path of the above YamlFile> --projectName 'Excellent Super' --className 'great sample' --copyrightYear 2025 --licenseStyle gpl --descriptions abc def ghi --properties 'property a' 'property b' 'property c'
Install #
You can download the latest version of citrus.exe from Releases.
Or it is also available as a dart package.