Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add general code generation features (#88)
* Update exception message * Improve library import determination * Remove factory method builder * Add test for the constructor generation * Update ALLOWED_PARAMETER_MODIFIERS constant value * Add missing negation for the isDartConventionFileName check * Remove trailing comma * Set named option to true for a parameter * Overhaul constructor generation to support more variants * Improve new line handling * Add required and this write to a parameter * Update constructor structure * Update type check to support nullable * The type variable is now nullable and add method to set the type * Emit new line when the "normal" parameters is not empty * Add test which contains all parameter combinations * Add method to check if a string is in the lowerCamelCase format and switch namePattern to RegEx from Kotlin * Add test class for the lowerCamelCase regex * Add EnumProperty structure * Add writer class for the EnumPropertySpec object * Add test class for the enum property writer * Replace some string usages with constant variable calls * Add documentation * Add dokka and changeLog as new entries * Update some plugin calls * Update junit5 monorepo to v5.9.3 * Improve multiple parameter writer * Add test for the property writer * Add test for the enum write * Improve enum test * Add enum writer and improve line breaks * Improve line breaks * Integrate enum properties into the class structure * Add constant values for a round open and close bracket * Update some string to its constant value equivalent * Remove internal keyword from the constructor * Annotations should not be inlined over classes * Update some boolean getter * Add isLibrary boolean * Improve generic write * Add test which generates a rest api handler class * Add test which test the cast option from a function * Add typeCast variable * Add tests for the new setter and property generation * Add variable and methods for the new setter and property generation * Update writer to add support for set and get functions * Add some temp fix for the line breaks * Improve intializer writing * Deprecate FunctionType interface * Add new test for a void method * Improve line break writing * Improve new line in the constructor write * Remove unused methods * Add some documentation and improve modifier usage * Add more checks to the init block also add documentation * Add new test and improve some other tests * Add hasAllowedModifiers method * Add some missing documentation * Add parameter to improve readability which boolean does what * Add documentation * Add more test cases to the property spec and update them to a parameterized test * Rename enum to CastType * Rename Import interface to Directive * Add base implementation for the Directive interface * Rename some existing classes and update them to the new structure * Update to the new structure and split relative "imports" into a own class * Add RelativeDirective class * Rename DartImportTest to DirectiveTest * Remove old test class * Rename PartImportTest to PartDirectiveTest * Add changes from the import renaming * Rename imports structure to directive * Add ExportDirective * Rename import dir to directive * Update package import * Rename imports call to directives * Add documentation * Update imports * Add annotation generation to enum properties * Integrate lambda option into the function structure * Add lambda writing * Add a test for a lambda method * Update lambda call and a test * Add ParameterizedTest for the simple properties and add test for a const property * Add constantStack variable and sort the modifiers * Improve class tests and add test for class constant values * Add constantStack variable and method to add a constant to the builder * Add constant write * Change modifiers to a set * Update modifier write * Add emitProperties extension method * Add constant writing * Outsource extension method * Add builder for const properties * Remove unused variable and add more allowed modifier sets * Add support for constants * Add test case which contains constant values * Add comment write * Update documentation chars * Add storage for comments * Add test which has comments * Add missing import * Update failing test * Add ability to add comments and add tests for that * Add comment writing * Improve multiline comment writing * Add comment write to functions * Update parameter and modifier usage * Add support for comments to the constructor structure * Add ability to add comments to a property * Add file test which test the combination of several structures with comments * Remove some unused imports and methods * Rename emitComment method to emitDoc * Update method call * Add missing method to an array of properties * Remove empty line * Update all method, variables which contains comment to something with doc * Update tests due the change to the comment method * Add documentation * Add documentation * Add documentation * Add documentation and remove methods which contains an iterable as parameter and replace them with an vararg parameter method * Update method implementation from the SpecMethods interface * Update dependency com.google.truth:truth to v1.1.4 * Remove some blank lines * Add some empty lines and improve naming from the project * Improve convention checks for the file name * Include enumProperties to the hasNoContent boolean and add documentation * Remove unused variable and add documentation * Update annotation usage * Remove FunctionType class and integration * Remove unused import * Remove todo * Remove unused import * Improve exception throw * Rename COMMENT entry to DOCUMENTATION_CHAR and add documentation * Remove constant value for allowed parameter modifiers * Remove unused methods, structures and improve license header * Add indent check to prevent invalid indent usage (#35) * Add method to check if an indent string contains only spaces * Update indent check * Update exception type in the assertThrows method calls * Add a test for the indent pattern * Update names of some spec und builder classes (#34) * Rename some classes to remove the Dart prefix from the file and class name * Update imports of the used spec structures --------- Co-authored-by: TheMeinerLP <p.glanz@madfix.me> * Update dependency com.google.truth:truth to v1.1.5 (#33) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency org.jetbrains.kotlin:kotlin-test-junit to v1.8.22 (#32) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency org.jetbrains.kotlin.jvm to v1.8.22 (#31) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency org.jetbrains.dokka to v1.8.20 (#30) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency org.jetbrains.changelog to v2.1.0 (#28) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Remove Dart prefix from the class names * Remove parameter import * Update import from the ParameterSpec * Update dependency gradle to v8.2 (#36) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency org.jetbrains.changelog to v2.1.1 (#39) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency org.jetbrains.kotlin.jvm to v1.9.0 (#37) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency gradle to v8.2.1 * Remove some unused code parts * Update dependency org.jetbrains.changelog to v2.1.2 (#41) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update junit5 monorepo to v5.10.0 (#43) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency gradle to v8.3 * Move the dependency declaration to the settings.gradle.kts file * Update dependency usage in the dependencies block * Move all plugin declarations into the settings.gradle.kts file * Update plugin usage * Implement method to create a builder from a spec reference * Enable commented parts and remove application plugin * Add versionRef for the junit dependencies * Add a test for the toBuilder method * Remove unused imports * Include missing parts to the toBuilder method * Update actions/checkout action to v4 * Update compilerOption usage * Add structure to support class structures as type (#54) * Add TypeName class * Add implementations for the TypeName * Add test for the TypeName class * Add TypeName usage to the annotation spec * Add support for type names * Add more logic to the type name structure and the implementations * Add method to format a string with the lowerCamelCase pattern * Add new tests * Add dynamic and required as new entries * Add documentation and support for TypeNames * Add support for the new TypeName structure * Update parameter writing to use the new typeName variable * Add DynamicClassName implementation to represents the dynamic keyword from Dart * Add more parameterizedBy method declarations * Add a check for the name variable * Add parseSimpleClass method * Update a few tests to the new typename structure * Add support for the typeName structure * Update write process to write the typeName * Update emit method * Update tests to use the new typeName structure * Add support for typeNames * Update property usage to typeNames * Add const value for the ConstClassName * Add classname implementation for the const keyword * Change superclass type to the typeName structure * Update type writing to support typeNames * Add internal keyword to the class * Add some documentation * Update documentation * Add documentation to the class * Update some ClassName usage * Update out comment test * Improve line handling * Add documentation * Remove wildcard import * Improve documentation * Remove unused import * Remove public keywords and unused method * Change dynamic word to const * Add more tests for the typename structure * Add missing documentation * Add documentation to the new methods * Move some class name fields into another file * Update actions/checkout digest to 8ade135 * Update typeCast option from a method to use the TypeName structure (#58) * Change typeCast type from string to TypeName * Add new tests to test the new generic cast structure * Remove methods which uses an iterable as parameter type (#59) * Fix failing tests * Update modifier handling * Fix invalid property usage for const properties and seperate constants from normal properties (#61) * Split the file constant into an own spec structure to reduce complexity * Add test class for the FileConstWriter * Integrate FileConstantSpec to replace the PropertySpec usage * Add test for the new structure * Improve property tests * Update file const write * Improve property writing * Add emitFileConst method * Update ALLOWED_CONST_MODIFIERS content * Improve allowed modifiers check * Replace check with require * Update validation checks and dedicated method for a property as constant * Mark type as nullable * Deprecate ConstClassName * Update type check * Improve property tests * Update content from the ALLOWED_CLASS_CONST_MODIFIERS constant * Update to the new spec structure for constant values * Update method call to write the constants * Rename constant writer * Update constant property access in the test cases * Remove old place for the constant spec structure * Change name of the constant property objects * Fix failing tests * Update dependency gradle to v8.4 (#60) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin org.jetbrains.kotlin.jvm to v1.9.10 (#49) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update actions/checkout digest to b4ffde6 (#65) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add abstraction layer for the code writers (#64) * Add some interfaces to reduce writer complexity * Update emit method call and improve code quality * Remove unused import * Update plugin org.jetbrains.changelog to v2.2.0 (#50) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update junit5 monorepo to v5.10.1 (#67) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin org.jetbrains.kotlin.jvm to v1.9.20 (#66) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin org.jetbrains.dokka to v1.9.10 (#51) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin org.jetbrains.kotlin.jvm to v1.9.21 (#68) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency gradle to v8.5 (#69) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update actions/setup-java action to v4 (#70) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency com.google.truth:truth to v1.2.0 (#71) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin org.jetbrains.kotlin.jvm to v1.9.22 (#72) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update issue templates (#73) * Add license badge * Fix license badge * Fix wrong project name in a text * Add config.yml file * Update behaviour bug template * Add title to the templates * Improve text in the bug template * Remove deprecated code (#76) * Implement directive alphabetic sorting (#74) * Add class which provides methods to sort directives * Add test for the import sorting * Update import handling in the file structure * Improve directive structure to allow sorting * Update directive writing * Move directive tests to another directory * Improve directive sorting and storing to minimize generation issues * Add new test which tests the directive ordering at a test class * Add override generation for functions * Add documentation * Improve documentation * File ends now with an empty line * Add write support for relative directives * Move relative directive generation * Remove print statement * Add generation of export directives (#75) * Add support for export directives * Add variable to store the export directive objects * Implement cast options * Add ExportDirectiveTest class * Remove unused import * Add file test with export directive * Fix some typos * Improve documentation * Improve code structure * Improve documentation * Revise typedef handling and generation (#77) * Outsource typedefs into an own structure * Add new extension method to write the typedef objects * Add structure to manage or write typedef objects * Integrate the updated typedef structure into other spec objects, writers * Add test classes for the typedef structure * Update given tests to support typedef creation * Remove typedef as valid function modifier * Remove empty line * Remove unused code * Improve code layout * Remove out commented code * Improve new line write * Add support for multiple cast arguments * Add test for the multiple cast arguments * Remove unused import * Improve documentation3 * Increase test coverage * Update documentation * Reduce code complexity which generates the directives (#79) * Improve documentation * Update basic directive tests * Reduce complexity from the directive write process * Update library keyword usage * Revise parameter generation (#78) * Add abstract keyword to the allowed keywords for functions * Add class which allows parameter filtering * Add second writeInitBlock which takes a spec object * Remove bracket parameters from the emitParameters method * Update writer structure * Update writer structure * Improve parameter write process for functions * Improve parameter sorting * Improve variable handling * Add new test cases * Remove this. call * Improve parameter generation * Add new test cases * Fix wrong changes from the latest merge * Update parameter generation in the typedefs * Add and update tests * Remove unused code * Remove leading space * Add usage of the DocumentationAppender * Implement factory to create directive objects (#80) * Add factory class to create directives * Add directive type enum * Update constructor definition from the directive implementations * Add test for the new factory * Update directive usage * Remove wildcard import * Fix test class * Remove unused getter * Remove unused import * Mark ParameterFilter as internal * Update copy method implementation * Add documentation * Remove empty line * Remove unused import * Replace empty string definitions with the constant equivalent * Update documentation * Improve documentation * Improve code documentation * Improve code structure to reduce duplicated code parts * Remove unused imports * Revise extension definition and generation (#81) * Add support for TypeNames, unnamed extension and more * Update extension tests * Update documentation writing * Update genericCast usage * Add method to get the raw data from a TypeName * Update cast writing * Update extension tests * Add jetbrains annnotations as dependency * Add experimental annotation usage and restore methods * Remove some methdods and update tests * Add some ApiStatus annotation usage * Remove unused import * Update dependency com.google.truth:truth to v1.3.0 (#82) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix invalid enum generation when specific conditions are present (#84) * Outsource enum tests into an own dedicated test class * Add check to minimize wrong generate code for enum classes * Add default annotations, documentation update (#85) * Add common annotations from Dart * Update basic annotation generation tests * Update documentation * Improve code structure * Fix invalid name pattern (#87) * Improve name pattern to allow files with multiple underscores and name tiles * Remove unused import * Add new test cases and cleanup class * Improve file naming test * Add test pr workflow * Fix missing `this` call on parameters which don't have a type (#90) * Fix missing this. call when the parameter has no type * Add missing this call * Prevent the addition of parameters to functions which don't have a type * Add constant for an error message * Add missing tests * Update message usage * Update gradle/wrapper-validation-action action to v2 (#91) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Improve parameter write * Update dependency gradle to v8.6 (#92) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update junit5 monorepo to v5.10.2 (#94) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency com.google.truth:truth to v1.4.0 (#93) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: TheMeinerLP <p.glanz@madfix.me>
- Loading branch information