GithubHelp home page GithubHelp logo

Comments (5)

jmfayard avatar jmfayard commented on May 19, 2024

I can work on that if you want @krzema12
I have experience working with https://github.com/square/kotlinpoet

from github-workflows-kt.

krzema12 avatar krzema12 commented on May 19, 2024

@jmfayard That would be really cool, let's try that! I thought about kotlinpoet, but then I figured it will be simpler to generate the whole code by hand because I don't have experience with kotlinpoet. However, I'm open to checking how kotlinpoet will work for us.

So far I don't have much: https://github.com/krzema12/github-actions-kotlin-dsl/commits/generator .
Quickly describing my idea and plan:

  • an independent Gradle module that handles wrappers code generation. Input for a single wrapper: actions's owner, name and version. Output: wrapper's code and target path
  • have a central place with a list of wrappers that should be generated
  • each wrapper should be customizable in terms of e.g. how a certain input should be modeled. Default is a string, but one could use various modes like "integer with special value" or "enumeration with custom value"
  • generating the wrappers on demand, not during building the library. In the future, we can thought about making it more intelligent, e.g. (re)generating only these that need to be (re)generated
  • best if generated code was kept in another source set, to distinguish it from the manually written code
  • prior to generation, remove all generated code so that no leftover from previous generations is left
  • have solid tests for different edge cases

I propose to implement and merge it often and in small pieces, so that if our ideas diverge, we can quickly sync and no large amount of work could be wasted in case of change of approach.

from github-workflows-kt.

jmfayard avatar jmfayard commented on May 19, 2024

I have a MVP here #75

from github-workflows-kt.

krzema12 avatar krzema12 commented on May 19, 2024

Nice milestone: all wrappers are now generated, there're no hand-crafted ones. What I plan to do still in this task:

  • in PRs, regenerate all wrappers so that adding a new one is as easy as adding a line to WrappersToGenerate
  • add a wrapper for actions/setup-node@v2 that @jmfayard added in PR #75

from github-workflows-kt.

jmfayard avatar jmfayard commented on May 19, 2024

Nice!

from github-workflows-kt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.