Skip to content

Commit d4d13ff

Browse files
Site changes [skip-ci]
1 parent 4eff002 commit d4d13ff

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

llms-full.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ https://gitlab.com/defold/private/-/archive/main/test-main.zip?private_token=per
14551455

14561456
### Advanced access authentication
14571457

1458-
When using the basic access authentication a user's access token and username will be shared on any repository used for the project. With a greater than 1 man team this can be an issue. To solve this issue a "read only" user needs to be used for library access to the repository, on GitHub this requires an organization, a team and a user who doesn't need to edit the repo (hence read only).
1458+
When using the basic access authentication a user's access token and username will be shared on any repository used for the project. With a greater than 1 man team this can be an issue. To solve this issue a "read only" user needs to be used for library access to the repository, on GitHub this requires an organization, a team and a user who doesn't need to edit the repo (hence read only).
14591459

14601460
GitHub Steps:
14611461
* [Create an organisation](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/creating-a-new-organization-from-scratch)
@@ -1465,7 +1465,7 @@ GitHub Steps:
14651465
* [Create or select a user to be part of this team](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/organizing-members-into-teams)
14661466
* Use the "basic access authentication" above to create a personal access token for this user
14671467

1468-
At this point the new user's authentication details can be committed and pushed to the repository. This will allow anyone working with your private repository to fetch it as a library without having edit permissions to the library itself.
1468+
At this point the new user's authentication details can be committed and pushed to the repository. This will allow anyone working with your private repository to fetch it as a library without having edit permissions to the library itself.
14691469

14701470
<div class='important' markdown='1'>
14711471
The read only user's token is fully accessible to anyone who can access the game repositories that are using the library.
@@ -1487,6 +1487,16 @@ Now the folders that you shared appear in the *Assets pane* and you can use ever
14871487

14881488
![Library setup done](https://defold.com/manuals/images/libraries/libraries_done.png)
14891489

1490+
## Editing Files in Library Dependencies
1491+
1492+
Files in libraries cannot be saved. You can make changes, and the editor will be able to build with those changes, which is useful for testing. However, the file itself remains unchanged, and all modifications will be discarded when the file is closed.
1493+
1494+
If you want to make changes to library files, make sure to create your own fork of the library and make changes there. Another option is to copy/paste the entire library folder into your project directory and use the local copy. In this case, your local folder will shadow the original dependency, and the dependency link should be removed from `game.project` (don’t forget to choose <kbd>Project ▸ Fetch Libraries</kbd> afterward).
1495+
1496+
`builtins` is also a library provided by the engine. If you want to edit files there, make sure to copy them into your project and use those instead of the original `builtins` files. For example, to modify `default.render_script`, copy both `/builtins/render/default.render` and `/builtins/render/default.render_script` into your project folder as `my_custom.render` and `my_custom.render_script`. Then, update your local `my_custom.render` to reference the `my_custom.render_script` instead of the built-in one, and set your custom `my_custom.render` in `game.project` under the Render setting.
1497+
1498+
If you copy-paste a material and want to use it across all components of a certain type, it might be useful to use [per-project templates](#manuals:editor).
1499+
14901500
## Broken references
14911501

14921502
Library sharing only includes files that are located under the shared folder(s). If you create something that references assets that are located outside of the shared hierarchy, the reference paths will be broken.

manuals/libraries.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: manual
33
language: en
44
github: https://github.com/defold/doc
5-
toc: ["Libraries","Setting up library sharing","Library URL","Basic access authentication","Advanced access authentication","Setting up library dependencies","Broken references","Name collisions"]
5+
toc: ["Libraries","Setting up library sharing","Library URL","Basic access authentication","Advanced access authentication","Setting up library dependencies","Editing Files in Library Dependencies","Broken references","Name collisions"]
66
title: Working with library projects in Defold
77
brief: The Libraries feature allows you to share assets between projects. This manual explains how it works.
88
---
@@ -75,7 +75,7 @@ https://gitlab.com/defold/private/-/archive/main/test-main.zip?private_token=per
7575

7676
### Advanced access authentication
7777

78-
When using the basic access authentication a user's access token and username will be shared on any repository used for the project. With a greater than 1 man team this can be an issue. To solve this issue a "read only" user needs to be used for library access to the repository, on GitHub this requires an organization, a team and a user who doesn't need to edit the repo (hence read only).
78+
When using the basic access authentication a user's access token and username will be shared on any repository used for the project. With a greater than 1 man team this can be an issue. To solve this issue a "read only" user needs to be used for library access to the repository, on GitHub this requires an organization, a team and a user who doesn't need to edit the repo (hence read only).
7979

8080
GitHub Steps:
8181
* [Create an organisation](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/creating-a-new-organization-from-scratch)
@@ -85,7 +85,7 @@ GitHub Steps:
8585
* [Create or select a user to be part of this team](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/organizing-members-into-teams)
8686
* Use the "basic access authentication" above to create a personal access token for this user
8787

88-
At this point the new user's authentication details can be committed and pushed to the repository. This will allow anyone working with your private repository to fetch it as a library without having edit permissions to the library itself.
88+
At this point the new user's authentication details can be committed and pushed to the repository. This will allow anyone working with your private repository to fetch it as a library without having edit permissions to the library itself.
8989

9090
<div class='important' markdown='1'>
9191
The read only user's token is fully accessible to anyone who can access the game repositories that are using the library.
@@ -107,6 +107,16 @@ Now the folders that you shared appear in the *Assets pane* and you can use ever
107107

108108
![Library setup done](../images/libraries/libraries_done.png)
109109

110+
## Editing Files in Library Dependencies
111+
112+
Files in libraries cannot be saved. You can make changes, and the editor will be able to build with those changes, which is useful for testing. However, the file itself remains unchanged, and all modifications will be discarded when the file is closed.
113+
114+
If you want to make changes to library files, make sure to create your own fork of the library and make changes there. Another option is to copy/paste the entire library folder into your project directory and use the local copy. In this case, your local folder will shadow the original dependency, and the dependency link should be removed from `game.project` (don’t forget to choose <kbd>Project ▸ Fetch Libraries</kbd> afterward).
115+
116+
`builtins` is also a library provided by the engine. If you want to edit files there, make sure to copy them into your project and use those instead of the original `builtins` files. For example, to modify `default.render_script`, copy both `/builtins/render/default.render` and `/builtins/render/default.render_script` into your project folder as `my_custom.render` and `my_custom.render_script`. Then, update your local `my_custom.render` to reference the `my_custom.render_script` instead of the built-in one, and set your custom `my_custom.render` in `game.project` under the Render setting.
117+
118+
If you copy-paste a material and want to use it across all components of a certain type, it might be useful to use [per-project templates](/manuals/editor/#creating-new-project-files).
119+
110120
## Broken references
111121

112122
Library sharing only includes files that are located under the shared folder(s). If you create something that references assets that are located outside of the shared hierarchy, the reference paths will be broken.

0 commit comments

Comments
 (0)