diff --git a/docs/snapcraft-advanced-features.md b/docs/snapcraft-advanced-features.md index cfc4c3265e..9b92ba2291 100644 --- a/docs/snapcraft-advanced-features.md +++ b/docs/snapcraft-advanced-features.md @@ -160,9 +160,9 @@ after: ``` As we never define the `curl` part in the above example, `snapcraft` will -check the Ubuntu Wiki, which is where we currently host examples of -successful snapcraft parts. The build order in this case would be `curl`, -then `main`. +check the Ubuntu [Wiki][wiki], +which is where we currently host examples of successful snapcraft parts. +The build order in this case would be `curl`, then `main`. ## Finishing steps @@ -270,8 +270,9 @@ add to the snap. ### Endless possibilities -Combining various plugins and parts and using the wiki plugin make `snapcraft` -incredibly versatile. On top of that, you can write [your own plugin] [plugin] -as well. +Combining various plugins and parts and using [the wiki][wiki] plugin make +`snapcraft` incredibly versatile. On top of that, you can write +[your own plugin] [plugin] as well. [plugin]: plugins.md +[wiki]: https://wiki.ubuntu.com/snapcraft/parts diff --git a/docs/snapcraft-parts.md b/docs/snapcraft-parts.md index dd36e38b95..8550b22178 100644 --- a/docs/snapcraft-parts.md +++ b/docs/snapcraft-parts.md @@ -164,3 +164,43 @@ If you only need to embed a Java runtime, add a part with the jdk type. This will pull a relocatable OpenJDK via the default-jdk Ubuntu package and will set the proper `JAVA_HOME` and `PATH` environment variables in wrapper scripts generated by snapcraft or when running the app locally. + + +## Reusing parts + +Successful snapcraft parts can be published in +[the wiki][wiki] and reused by other snapcraft.yaml files. A part that does +not include the 'plugin' option will be searched for on [the wiki][wiki] and +the content from there will be used to build the part locally. As the number +of published parts increases, writing a snapcraft.yaml file will get easier +because one would simply include a set of published parts and the local part(s) +specific to the snap being created. + +The format of the wiki entries is a stream of YAML documents with the following +required fields: + + * origin - The url where the snapcraft.yaml is located + * project-part - The actual part to be published + * description - A brief description of the part. + * maintainer - The person who maintains the part's name and email address. + +Optional fields are: + + * origin-type - A hint about the type of project that contains the part. (e.g. bzr, git, tar) + * parts - A YAML list of other parts from the snapcraft.yaml that are needed to use the project-part. + +### Note: + +It can take up to an hour for updates to the wiki to become available to snapcraft. + +### Example: + +```yaml +--- +project-part: curl +origin: https://github.com/curl/curl +maintainer: John Doe +parts: [libcurl] +``` + +[wiki]: https://wiki.ubuntu.com/snapcraft/parts