25
25
import software .amazon .smithy .typescript .codegen .integration .TypeScriptIntegration ;
26
26
import software .amazon .smithy .utils .IoUtils ;
27
27
28
-
29
28
public class AwsPackageFixturesGeneratorIntegration implements TypeScriptIntegration {
30
29
@ Override
31
30
public void writeAdditionalFiles (
@@ -35,24 +34,20 @@ public void writeAdditionalFiles(
35
34
BiConsumer <String , Consumer <TypeScriptWriter >> writerFactory
36
35
) {
37
36
writerFactory .accept (".gitignore" , writer -> {
38
- String resource = IoUtils .readUtf8Resource (
39
- getClass ().getClassLoader (), "software/amazon/smithy/aws/typescript/codegen/gitignore" );
37
+ String resource = IoUtils .readUtf8Resource (getClass (), "gitignore" );
40
38
writer .write (resource );
41
39
});
42
40
writerFactory .accept (".npmignore" , writer -> {
43
- String resource = IoUtils .readUtf8Resource (
44
- getClass ().getClassLoader (), "software/amazon/smithy/aws/typescript/codegen/npmignore" );
41
+ String resource = IoUtils .readUtf8Resource (getClass (), "npmignore" );
45
42
writer .write (resource );
46
43
});
47
44
writerFactory .accept ("LICENCE" , writer -> {
48
- String resource = IoUtils .readUtf8Resource (
49
- getClass ().getClassLoader (), "software/amazon/smithy/aws/typescript/codegen/LICENCE.template" );
45
+ String resource = IoUtils .readUtf8Resource (getClass (), "LICENCE.template" );
50
46
resource = resource .replace ("${year}" , Integer .toString (Calendar .getInstance ().get (Calendar .YEAR )));
51
47
writer .write (resource );
52
48
});
53
49
writerFactory .accept ("README.md" , writer -> {
54
- String resource = IoUtils .readUtf8Resource (
55
- getClass ().getClassLoader (), "software/amazon/smithy/aws/typescript/codegen/README.md.template" );
50
+ String resource = IoUtils .readUtf8Resource (getClass (), "README.md.template" );
56
51
resource = resource .replaceAll ("\\ $\\ {packageName\\ }" , settings .getPackageName ());
57
52
writer .write (resource );
58
53
});
0 commit comments