Skip to content

Question: How to set author, date etc. individually for each file? #747

Open
@dhs-rec

Description

@dhs-rec

We currently have a setup with this in build.gradle:

ext {
  (author, date) = 'git log -1 --pretty=%an;%ci'.execute().text.trim().split(';')
  revision = 'git describe --always'.execute().text.trim()
}

asciidoctor {
  outputDir project.rootDir.path + '/build/docs'
  sourceDir file('documentation')
  sources {
    include '**/*.adoc'
  }
  asciidoctorj {
    attributes = [
      author: project.author,
      docdatetime: project.date,
      revdate: project.date,
      revnumber: project.revision,
    ]
  }
}

This puts the author and date of the current commit into every document. I'd prefer each file to contain the author and date of the last commit which affected that file (as in (author, date) = 'git log -1 --pretty=%an;%ci -- path/to/file'.execute().text.trim().split(';') ).

Is this possible somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions