Datafiles

Last updated 2 months ago

Datafiles are stored inside the folder AarKay/AarKayData/{PluginName} and each Datafile also consists of two components seperated by "."

  • Filename - MyFirstPlugin

  • Templatefile - MyFirstPlugin

We already have one Datafile inside AarKay/AarKayData/myfirstplugin/IntegrationTests with the name File.MyFirstPlugin.yml and contents as follows.

name: AarKay

Let's create a subdirectory inside AarKay/AarKayData/myfirstplugin/IntegrationTests with the name Sources and a Datafile with the name {YourName}.MyFirstPlugin.yml and the contents as follows.

name: Rahul

Now run the command sh scripts/run.

You will notice a new file created at IntegrationTests/Sources/{{YourName}}.swift and it used the same subdirectory Sources as we created in our Datafiles.

Datafile Collection

Sometimes creating one to one mapping of Datafile to Generatedfile can be an overkill so AarKay has a feature to mark a datafile as a collection datafile inside its name.

Let's rename that datafile to [].MyFirstPlugin.yml and change the contents inside it to an array of objects as follows

- name: Rahul
- name: John
- name: Peter
- name: Daniel
- name: Judah
- name: Job
- name: Josheph

Now run the command sh scripts/run.

For each object inside the collection Datafile, AarKay will generate the respective file.