Skip to content

pacmak: support local dependencies (and more) - #106

Merged
eladb merged 3 commits into
masterfrom
benisrae/pacmak-local-builds
Jul 30, 2018
Merged

eladb merged 3 commits into
masterfrom
benisrae/pacmak-local-builds

Conversation

@eladb

@eladb eladb commented Jul 30, 2018 •

Copy link
Copy Markdown
Contributor

Added a few features to jsii-pacmak:

  • --targets: allow specifying multiple targets when running pacmak.
  • --recurse: build all dependencies.
  • outdir and targets default to the values from package.json/jsii
  • -v: print INFO messages
  • -vv: print VERBOSE messages
  • --no-clean: keep generated source code after build

Outputs will go to outdir/target if multiple targets are specified
or just outdir if only a single target is required.

When using --recurse, --outdir applies to all modules, which means
that all the artifacts will be emitted into the same output directory.
In this case if --outdir is not specified, each target's outdir
is respected (from package.json).

Java: if one of the dependencies of a module has a local output,
it will be added as a local maven repository, so it is now possible
to depend on a local build instead of always going to maven central.

Changes to calc test library:

  • Added sphinx output to calc test modules.
  • Changed groupId to com.amazonaws.jsii

Fixes #73

Added a few features to jsii-pacmak:

* --targets: allow specifying multiple targets when running pacmak.
* --recurse: build all dependencies.
* outdir and targets default to the values from package.json/jsii
* -v: print INFO messages
* -vv: print VERBOSE messages
* --no-clean: keep generated source code after build

Outputs will go to <outdir>/<target> if multiple targets are specified
or just <outdir> if only a single target is required.

When using --recurse, --outdir applies to all modules, which means
that all the artifacts will be emitted into the same output directory.
In this case if --outdir is not specified, each target's outdir
is respected (from package.json).

Java: if one of the dependencies of a module has a local output,
it will be added as a local maven repository, so it is now possible
to depend on a local build instead of always going to maven central.

Changes to calc test library:
* Added `sphinx` output to calc test modules.
* Changed groupId to com.amazonaws.jsii
@eladb
eladb requested a review from RomainMuller July 30, 2018 11:44

@RomainMuller RomainMuller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing major :)

@@ -0,0 +1,16 @@
export let level = 0;

export const LEVEL_INFO = 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export enum Level {
    QUIET = 0,
    INFO = 1,
    VERBOSE = 2
}

Then have a log(level: Level, fmt: string, ...args: any[]) method; and keep the short-hand aliases for each level.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


export interface TargetOptions {
/** The name of the target language we are generating */
targetName: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's passed in by the creator where I think it should be owned by the implementation. Maybe Target should have an abstract property for that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically you are right, but it's based on the file name of the generator, so KISS

localRepos.push(localJavaRuntime);
}

await fs.writeFile(filePath, `<?xml version="1.0" encoding="UTF-8"?>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would largely prefer you use xmlbuilder for this.

* Refactor logging implementation
* Use xmlbuilder to generate user.xml
@eladb
eladb merged commit 6e6d7c7 into master Jul 30, 2018
@eladb
eladb deleted the benisrae/pacmak-local-builds branch July 30, 2018 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants