├── .github
├── beantojson_factory.gif
├── dependabot.yml
├── jetbrains-variant.png
└── workflows
│ ├── build.yml
│ ├── release.yml
│ └── run-ui-tests.yml
├── .gitignore
├── .run
├── Run IDE for UI Tests.run.xml
├── Run IDE with Plugin.run.xml
├── Run Plugin Tests.run.xml
├── Run Plugin Verification.run.xml
└── Run Qodana.run.xml
├── CHANGELOG.md
├── CODEOWNERS
├── LICENSE
├── README.md
├── build.gradle.kts
├── gradle.properties
├── gradle
├── libs.versions.toml
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── qodana.yml
├── settings.gradle.kts
├── src
├── main
│ ├── kotlin
│ │ └── com
│ │ │ └── github
│ │ │ └── zhangruiyu
│ │ │ └── flutterjsonbeanfactory
│ │ │ ├── Flag.kt
│ │ │ ├── action
│ │ │ ├── class_body_generate
│ │ │ │ ├── DartGenerateCopyAction.kt
│ │ │ │ ├── DartGenerateCopyFix.kt
│ │ │ │ └── DartGenerateCopyHandler.kt
│ │ │ ├── dart_to_helper
│ │ │ │ ├── FlutterBeanFactoryAction.kt
│ │ │ │ ├── model
│ │ │ │ │ └── FieldInfo.kt
│ │ │ │ └── node
│ │ │ │ │ ├── ClassGeneratorInfoModel.kt
│ │ │ │ │ └── GeneratorDartClassNodeToHelperInfo.kt
│ │ │ └── jsontodart
│ │ │ │ ├── ClassDefinition.kt
│ │ │ │ ├── CollectInfo.kt
│ │ │ │ ├── JsonToDartBeanAction.kt
│ │ │ │ ├── ModelGenerator.kt
│ │ │ │ └── utils
│ │ │ │ └── Helper.kt
│ │ │ ├── file
│ │ │ └── FileHelpers.kt
│ │ │ ├── setting
│ │ │ ├── SettingComponent.kt
│ │ │ ├── SettingLayout.kt
│ │ │ └── Settings.kt
│ │ │ ├── ui
│ │ │ ├── JsonInputDialog.kt
│ │ │ └── VerticalFlowLayout.kt
│ │ │ ├── utils
│ │ │ ├── Extensions.kt
│ │ │ ├── FieldUtils.kt
│ │ │ ├── GsonUtil.kt
│ │ │ ├── JsonUtils.kt
│ │ │ ├── LogUtil.kt
│ │ │ ├── SimplifiedMethods.kt
│ │ │ ├── StringExt.kt
│ │ │ ├── VirtualFileExt.kt
│ │ │ └── YamlHelper.kt
│ │ │ └── workers
│ │ │ ├── FileGenerator.kt
│ │ │ └── Initializer.kt
│ └── resources
│ │ ├── META-INF
│ │ ├── plugin.xml
│ │ └── pluginIcon.svg
│ │ ├── icons
│ │ └── action.png
│ │ └── messages
│ │ └── MyBundle.properties
└── test
│ ├── kotlin
│ └── com
│ │ └── github
│ │ └── zhangruiyu
│ │ └── flutterjsonbeanfactory
│ │ └── MyPluginTest.kt
│ └── testData
│ └── rename
│ ├── foo.xml
│ └── foo_after.xml
├── test_data.json
└── wechat_pay.png
/.github/beantojson_factory.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fluttercandies/FlutterJsonBeanFactory/f25572e8ba9ba9158a0243c4aa2d67336b4dbbad/.github/beantojson_factory.gif
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Dependabot configuration:
2 | # https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
3 |
4 | version: 2
5 | updates:
6 | # Maintain dependencies for Gradle dependencies
7 | - package-ecosystem: "gradle"
8 | directory: "/"
9 | target-branch: "next"
10 | schedule:
11 | interval: "daily"
12 | # Maintain dependencies for GitHub Actions
13 | - package-ecosystem: "github-actions"
14 | directory: "/"
15 | target-branch: "next"
16 | schedule:
17 | interval: "daily"
18 |
--------------------------------------------------------------------------------
/.github/jetbrains-variant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fluttercandies/FlutterJsonBeanFactory/f25572e8ba9ba9158a0243c4aa2d67336b4dbbad/.github/jetbrains-variant.png
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | # GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
2 | # - validate Gradle Wrapper,
3 | # - run test and verifyPlugin tasks,
4 | # - run buildPlugin task and prepare artifact for the further tests,
5 | # - run IntelliJ Plugin Verifier,
6 | # - create a draft release.
7 | #
8 | # Workflow is triggered on push and pull_request events.
9 | #
10 | # Docs:
11 | # - GitHub Actions: https://help.github.com/en/actions
12 | # - IntelliJ Plugin Verifier GitHub Action: https://github.com/ChrisCarini/intellij-platform-plugin-verifier-action
13 | #
14 | ## JBIJPPTPL
15 |
16 | name: Build
17 | on:
18 | # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
19 | push:
20 | branches: [main]
21 | # Trigger the workflow on any pull request
22 | pull_request:
23 |
24 | jobs:
25 |
26 | # Run Gradle Wrapper Validation Action to verify the wrapper's checksum
27 | gradleValidation:
28 | name: Gradle Wrapper
29 | runs-on: ubuntu-latest
30 | steps:
31 |
32 | # Check out current repository
33 | - name: Fetch Sources
34 | uses: actions/checkout@v2.3.4
35 |
36 | # Validate wrapper
37 | - name: Gradle Wrapper Validation
38 | uses: gradle/wrapper-validation-action@v1.0.4
39 |
40 | # Run verifyPlugin and test Gradle tasks
41 | test:
42 | name: Test
43 | needs: gradleValidation
44 | runs-on: ubuntu-latest
45 | steps:
46 |
47 | # Check out current repository
48 | - name: Fetch Sources
49 | uses: actions/checkout@v2.3.4
50 |
51 | # Setup Java 11 environment for the next steps
52 | - name: Setup Java
53 | uses: actions/setup-java@v2
54 | with:
55 | distribution: zulu
56 | java-version: 11
57 | cache: gradle
58 |
59 | # Set environment variables
60 | - name: Export Properties
61 | id: properties
62 | shell: bash
63 | run: |
64 | PROPERTIES="$(./gradlew properties --console=plain -q)"
65 | IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)"
66 |
67 | echo "::set-output name=ideVersions::$IDE_VERSIONS"
68 | echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
69 |
70 | # Cache Plugin Verifier IDEs
71 | - name: Setup Plugin Verifier IDEs Cache
72 | uses: actions/cache@v2.1.6
73 | with:
74 | path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
75 | key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }}
76 |
77 | # Run Qodana inspections
78 | - name: Qodana - Code Inspection
79 | uses: JetBrains/qodana-action@v2.1-eap
80 |
81 | # Run tests
82 | - name: Run Tests
83 | run: ./gradlew test
84 |
85 | # Run verifyPlugin Gradle task
86 | - name: Verify Plugin
87 | run: ./gradlew verifyPlugin
88 |
89 | # Run IntelliJ Plugin Verifier action using GitHub Action
90 | - name: Run Plugin Verifier
91 | run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
92 |
93 | # Build plugin with buildPlugin Gradle task and provide the artifact for the next workflow jobs
94 | # Requires test job to be passed
95 | build:
96 | name: Build
97 | needs: test
98 | runs-on: ubuntu-latest
99 | outputs:
100 | version: ${{ steps.properties.outputs.version }}
101 | changelog: ${{ steps.properties.outputs.changelog }}
102 | steps:
103 |
104 | # Check out current repository
105 | - name: Fetch Sources
106 | uses: actions/checkout@v2.3.4
107 |
108 | # Setup Java 11 environment for the next steps
109 | - name: Setup Java
110 | uses: actions/setup-java@v2
111 | with:
112 | distribution: zulu
113 | java-version: 11
114 | cache: gradle
115 |
116 | # Set environment variables
117 | - name: Export Properties
118 | id: properties
119 | shell: bash
120 | run: |
121 | PROPERTIES="$(./gradlew properties --console=plain -q)"
122 | VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
123 | NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
124 | CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
125 | CHANGELOG="${CHANGELOG//'%'/'%25'}"
126 | CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
127 | CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
128 |
129 | echo "::set-output name=version::$VERSION"
130 | echo "::set-output name=name::$NAME"
131 | echo "::set-output name=changelog::$CHANGELOG"
132 |
133 | # Build artifact using buildPlugin Gradle task
134 | - name: Build Plugin
135 | run: ./gradlew buildPlugin
136 |
137 | # Store built plugin as an artifact for downloading
138 | - name: Upload artifacts
139 | uses: actions/upload-artifact@v2.2.4
140 | with:
141 | name: "${{ steps.properties.outputs.name }} - ${{ steps.properties.outputs.version }}"
142 | path: ./build/distributions/*
143 |
144 | # Prepare a draft release for GitHub Releases page for the manual verification
145 | # If accepted and published, release workflow would be triggered
146 | releaseDraft:
147 | name: Release Draft
148 | if: github.event_name != 'pull_request'
149 | needs: build
150 | runs-on: ubuntu-latest
151 | steps:
152 |
153 | # Check out current repository
154 | - name: Fetch Sources
155 | uses: actions/checkout@v2.3.4
156 |
157 | # Remove old release drafts by using the curl request for the available releases with draft flag
158 | - name: Remove Old Release Drafts
159 | env:
160 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161 | run: |
162 | gh api repos/{owner}/{repo}/releases \
163 | --jq '.[] | select(.draft == true) | .id' \
164 | | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
165 |
166 | # Create new release draft - which is not publicly visible and requires manual acceptance
167 | - name: Create Release Draft
168 | env:
169 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
170 | run: |
171 | gh release create v${{ needs.build.outputs.version }} \
172 | --draft \
173 | --title "v${{ needs.build.outputs.version }}" \
174 | --notes "${{ needs.build.outputs.changelog }}"
175 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | # GitHub Actions Workflow created for handling the release process based on the draft release prepared
2 | # with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided.
3 |
4 | name: Release
5 | on:
6 | release:
7 | types: [prereleased, released]
8 |
9 | jobs:
10 |
11 | # Prepare and publish the plugin to the Marketplace repository
12 | release:
13 | name: Publish Plugin
14 | runs-on: ubuntu-latest
15 | steps:
16 |
17 | # Check out current repository
18 | - name: Fetch Sources
19 | uses: actions/checkout@v2.3.4
20 | with:
21 | ref: ${{ github.event.release.tag_name }}
22 |
23 | # Setup Java 11 environment for the next steps
24 | - name: Setup Java
25 | uses: actions/setup-java@v2
26 | with:
27 | distribution: zulu
28 | java-version: 11
29 | cache: gradle
30 |
31 | # Update Unreleased section with the current release note
32 | - name: Patch Changelog
33 | run: |
34 | ./gradlew patchChangelog --release-note="`cat << EOM
35 | ${{ github.event.release.body }}
36 | EOM`"
37 |
38 | # Publish the plugin to the Marketplace
39 | - name: Publish Plugin
40 | env:
41 | PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
42 | run: ./gradlew publishPlugin
43 |
44 | # Upload artifact as a release asset
45 | - name: Upload Release Asset
46 | env:
47 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 | run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
49 |
50 | # Create pull request
51 | - name: Create Pull Request
52 | env:
53 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54 | run: |
55 | VERSION="${{ github.event.release.tag_name }}"
56 | BRANCH="changelog-update-$VERSION"
57 |
58 | git config user.email "action@github.com"
59 | git config user.name "GitHub Action"
60 |
61 | git checkout -b $BRANCH
62 | git commit -am "Changelog update - $VERSION"
63 | git push --set-upstream origin $BRANCH
64 |
65 | gh pr create \
66 | --title "Changelog update - \`$VERSION\`" \
67 | --body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
68 | --base main \
69 | --head $BRANCH
70 |
--------------------------------------------------------------------------------
/.github/workflows/run-ui-tests.yml:
--------------------------------------------------------------------------------
1 | # GitHub Actions Workflow created for launching UI tests on Linux, Windows, and Mac in the following steps:
2 | # - prepare and launch Idea with your plugin and robot-server plugin, which is need to interact with UI
3 | # - wait for the Idea started
4 | # - run UI tests with separate Gradle task
5 | #
6 | # Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ IDEA.
7 | #
8 | # Workflow is triggered manually.
9 |
10 | name: Run UI Tests
11 | on:
12 | workflow_dispatch
13 |
14 | jobs:
15 |
16 | testUI:
17 | runs-on: ${{ matrix.os }}
18 | strategy:
19 | fail-fast: false
20 | matrix:
21 | include:
22 | - os: ubuntu-latest
23 | runIde: |
24 | export DISPLAY=:99.0
25 | Xvfb -ac :99 -screen 0 1920x1080x16 &
26 | gradle runIdeForUiTests &
27 | - os: windows-latest
28 | runIde: start gradlew.bat runIdeForUiTests
29 | - os: macos-latest
30 | runIde: ./gradlew runIdeForUiTests &
31 |
32 | steps:
33 |
34 | # Check out current repository
35 | - name: Fetch Sources
36 | uses: actions/checkout@v2.3.4
37 |
38 | # Setup Java 11 environment for the next steps
39 | - name: Setup Java
40 | uses: actions/setup-java@v2
41 | with:
42 | distribution: zulu
43 | java-version: 11
44 | cache: gradle
45 |
46 | # Run IDEA prepared for UI testing
47 | - name: Run IDE
48 | run: ${{ matrix.runIde }}
49 |
50 | # Wait for IDEA to be started
51 | - name: Health Check
52 | uses: jtalk/url-health-check-action@v1.5
53 | with:
54 | url: http://127.0.0.1:8082
55 | max-attempts: 15
56 | retry-delay: 30s
57 |
58 | # Run tests
59 | - name: Tests
60 | run: ./gradlew test
61 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | .idea
3 | .qodana
4 | build
5 |
--------------------------------------------------------------------------------
/.run/Run IDE for UI Tests.run.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
15 |
16 |
17 | true
18 | true
19 | false
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.run/Run IDE with Plugin.run.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
17 |
18 |
19 | true
20 | true
21 | false
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.run/Run Plugin Tests.run.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | true
20 | true
21 | false
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/.run/Run Plugin Verification.run.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | true
20 | true
21 | false
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/.run/Run Qodana.run.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | true
22 | true
23 | false
24 |
25 |
26 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # FlutterJsonBeanFactory Changelog
4 |
5 | ## Unreleased
6 |
7 | ## 5.2.4
8 |
9 | ### Changed
10 |
11 | - late field is more intelligent
12 |
13 | ## 5.2.2
14 |
15 | ### Changed
16 |
17 | - double quotation marks are changed to single quotation marks
18 |
19 | ## 5.2.1
20 |
21 | ### Changed
22 |
23 | - fix [issues/167](https://github.com/fluttercandies/FlutterJsonBeanFactory/issues/167)
24 |
25 | ## 5.2.0
26 |
27 | ### Changed
28 |
29 | - update gradle and kotlin
30 | - fix idea version low version problem
31 |
32 | ## 5.1.7
33 |
34 | ### Changed
35 |
36 | - fixed conflicts with freezed
37 |
38 | ## 5.1.6
39 |
40 | ### Changed
41 |
42 | - Fix issues-161, map type conversion issue
43 |
44 | ## 5.1.5
45 |
46 | - support nested key,such as: @JSONField(name:"login.user.name")
47 |
48 | ## 5.1.3
49 |
50 | ### Changed
51 |
52 | - fix idea 2023.3.2 checkbox not fond exception
53 |
54 | ## 5.1.2
55 |
56 | ### Changed
57 |
58 | - After adding analysis, the type error problem is resolved
59 | - add copyWith annotation
60 | - pr: https://github.com/fluttercandies/FlutterJsonBeanFactory/pull/151
61 | - When there is no field in the class, the copyWith generation error occurs
62 | - Support default value(list)
63 | - Fixed an issue where hot reload would not refresh convertFuncMap after adding the model class
64 | - copyWith private field bugfix
65 |
66 | ## 5.0.3
67 |
68 | ### Changed
69 |
70 | - copyWith move to .g.dart
71 |
72 | ## 5.0.0
73 |
74 | ### Changed
75 |
76 | - supper map list