Skip to content

Remove the generate step #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ build:: install_plugins provider build_sdks install_sdks
only_build:: build

tfgen:: install_plugins
(cd provider && go build -o $(WORKING_DIR)/bin/${TFGEN} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${TFGEN})
cd provider && go build -o $(WORKING_DIR)/bin/${TFGEN} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${TFGEN}
$(WORKING_DIR)/bin/${TFGEN} schema --out provider/cmd/${PROVIDER}
(cd provider && VERSION=$(VERSION) go generate cmd/${PROVIDER}/main.go)

provider:: tfgen install_plugins # build the provider binary
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${PROVIDER})
Expand Down Expand Up @@ -99,8 +98,8 @@ cleanup:: # cleans up the temporary directory

help::
@grep '^[^.#]\+:\s\+.*#' Makefile | \
sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \
expand -t20
sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \
expand -t20

clean::
rm -rf sdk/{dotnet,nodejs,go,python}
Expand Down

Choose a reason for hiding this comment

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

intended?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep. It's used during plugin discovery and auto-generated.

Empty file.
63 changes: 0 additions & 63 deletions provider/cmd/pulumi-resource-xyz/generate.go

This file was deleted.

4 changes: 1 addition & 3 deletions provider/cmd/pulumi-resource-xyz/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:generate go run ./generate.go

package main

import (
Expand All @@ -24,7 +22,7 @@ import (
"github.com/pulumi/pulumi-xyz/provider/pkg/version"
)

//go:embed schema-embed.json
//go:embed schema.json
var pulumiSchema []byte

func main() {
Expand Down
114 changes: 114 additions & 0 deletions provider/cmd/pulumi-resource-xyz/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"name": "xyz",
"description": "A Pulumi package for creating and managing xyz cloud resources.",
"keywords": [
"abc",
"xyz",
"category/cloud"
],
"homepage": "https://www.pulumi.com",
"license": "Apache-2.0",
"attribution": "This Pulumi package is based on the [`xyz` Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz).",
"repository": "https://github.com/pulumi/pulumi-xyz",
"publisher": "abc",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
},
"language": {
"csharp": {
"packageReferences": {
"Pulumi": "3.*"
},
"compatibility": "tfbridge20"
},
"go": {
"importBasePath": "github.com/pulumi/pulumi-xyz/sdk/go/xyz",
"generateResourceContainerTypes": true,
"generateExtraInputTypes": true
},
"nodejs": {
"packageDescription": "A Pulumi package for creating and managing xyz cloud resources.",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-xyz` repo](https://github.com/pulumi/pulumi-xyz/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-xyz` repo](https://github.com/terraform-providers/terraform-provider-xyz/issues).",
"dependencies": {
"@pulumi/pulumi": "^3.0.0"
},
"devDependencies": {
"@types/mime": "^2.0.0",
"@types/node": "^10.0.0"
},
"compatibility": "tfbridge20",
"disableUnionOutputTypes": true
},
"python": {
"requires": {
"pulumi": "\u003e=3.0.0,\u003c4.0.0"
},
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-xyz` repo](https://github.com/pulumi/pulumi-xyz/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-xyz` repo](https://github.com/terraform-providers/terraform-provider-xyz/issues).",
"compatibility": "tfbridge20",
"pyproject": {}
}
},
"config": {},
"provider": {
"description": "The provider type for the xyz package. By default, resources use package-wide configuration\nsettings, however an explicit `Provider` instance may be created and passed during resource\nconstruction to achieve fine-grained programmatic control over provider settings. See the\n[documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.\n"
},
"resources": {
"xyz:index/resource:Resource": {
"properties": {
"sampleAttribute": {
"type": "string",
"description": "Sample attribute.\n"
}
},
"inputProperties": {
"sampleAttribute": {
"type": "string",
"description": "Sample attribute.\n"
}
},
"stateInputs": {
"description": "Input properties used for looking up and filtering Resource resources.\n",
"properties": {
"sampleAttribute": {
"type": "string",
"description": "Sample attribute.\n"
}
},
"type": "object"
}
}
},
"functions": {
"xyz:index/getDataSource:getDataSource": {
"inputs": {
"description": "A collection of arguments for invoking getDataSource.\n",
"properties": {
"sampleAttribute": {
"type": "string"
}
},
"type": "object",
"required": [
"sampleAttribute"
]
},
"outputs": {
"description": "A collection of values returned by getDataSource.\n",
"properties": {
"id": {
"type": "string",
"description": "The provider-assigned unique ID for this managed resource.\n"
},
"sampleAttribute": {
"type": "string"
}
},
"type": "object",
"required": [
"sampleAttribute",
"id"
]
}
}
}
}
Loading