Mortar Generator

Generates the various files needed for each Screen when using Square's Flow and Mortar

License

License

GroupId

GroupId

com.wemakebetterapps
ArtifactId

ArtifactId

mortar-gen
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Mortar Generator
Generates the various files needed for each Screen when using Square's Flow and Mortar
Project URL

Project URL

https://github.com/WeMakeBetterApps/MortarLib
Source Code Management

Source Code Management

http://github.com/wemakebetterapps/mortarlib

Download mortar-gen

How to add to project

<!-- https://jarcasting.com/artifacts/com.wemakebetterapps/mortar-gen/ -->
<dependency>
    <groupId>com.wemakebetterapps</groupId>
    <artifactId>mortar-gen</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.wemakebetterapps/mortar-gen/
implementation 'com.wemakebetterapps:mortar-gen:1.1.0'
// https://jarcasting.com/artifacts/com.wemakebetterapps/mortar-gen/
implementation ("com.wemakebetterapps:mortar-gen:1.1.0")
'com.wemakebetterapps:mortar-gen:jar:1.1.0'
<dependency org="com.wemakebetterapps" name="mortar-gen" rev="1.1.0">
  <artifact name="mortar-gen" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.wemakebetterapps', module='mortar-gen', version='1.1.0')
)
libraryDependencies += "com.wemakebetterapps" % "mortar-gen" % "1.1.0"
[com.wemakebetterapps/mortar-gen "1.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.freemarker : freemarker jar 2.3.20

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

MortarLib

Supports building Android apps using Square's Flow and Mortar.

APIs aren't finalized yet. Flow and Mortar are still in rapid development, and as such still is this. As I use Flow and Mortar, if I find the need to write a component that is a potential common use case it will be added to this library. Pull requests are welcome.


Currently supports Flow 0.7, and Mortar 0.16. Will be updated to Flow 0.9 when it's officially released.

Gradle Usage:

compile 'com.wemakebetterapps:mortar-lib:1.2.1'
compile 'com.squareup.flow:flow:0.7'
compile 'com.squareup.mortar:mortar:0.16'

Screen Generator Sample

Creating a new screen using Flow & Mortar is an effort unto itself, so included is a Screen Generator. It will generate your Screen, Presenter, Module, view, and xml file with all the necessary boiler plate. It's recommended that you set this up as a separate java project.

compile 'com.wemakebetterapps:mortar-gen:1.1.0'
public class ExampleScreenGenerator {

  public static void main(String[] args) {
    ScreenGenerator.ScreenGeneratorPrefs prefs =
        new ScreenGenerator.ScreenGeneratorPrefs(
            new File("app/src/main/java"),
            new File("app/src/main/res/layout"),
            "com.example.app",
            "com.example.app.screen",
            "view"
        ).customPresenter("com.example.app.presenter", "BasePresenter")
            .defaultBaseModule("com.example.app.screen", "MainScreen.Module")
            .presenterPackage("com.example.app.presenter");

    new ScreenGenerator(prefs).start();
  }

}

Versions

Version
1.1.0
1.0.0